Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
20
Task/Hamming-numbers/MATLAB/hamming-numbers.m
Normal file
20
Task/Hamming-numbers/MATLAB/hamming-numbers.m
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
n = 40;
|
||||
|
||||
powers_2 = 2.^[0:n-1];
|
||||
powers_3 = 3.^[0:n-1];
|
||||
powers_5 = 5.^[0:n-1];
|
||||
|
||||
matrix = powers_2' * powers_3;
|
||||
powers_23 = sort(reshape(matrix,n*n,1));
|
||||
|
||||
|
||||
matrix = powers_23 * powers_5;
|
||||
powers_235 = sort(reshape(matrix,n*n*n,1));
|
||||
|
||||
%
|
||||
% Remove the integer overflow values.
|
||||
%
|
||||
powers_235 = powers_235(powers_235 > 0);
|
||||
|
||||
disp(powers_235(1:20))
|
||||
disp(powers_235(1691))
|
||||
Loading…
Add table
Add a link
Reference in a new issue