(In reply to
re(2): Solution? - confirmation by Math Man)
Rather than build the numbers, the program tests all even numbers up to the highest value desired. The output of Steven's build-up method is placed to the right.
clc
for n=2:2:8000000
ns=char(string(n));
n2=n/2;
while mod(n2,2)==0
n2=n2/2;
end
m=char(string(n2));
tst=strfind(ns,m);
if ~isempty(tst)
disp(n)
end
end
16 16
128 128
384 384
512 512
1024 1024
1536 1536
1792 1792
2176 2176
2560 2560
2912 2912
3072 3072
5120 5120
7168 7168
8192 8192
9216 9216
11264 11264
13312 13312
15360 15360
15616 15616
16384 16384
17408 17408
19456 19456
21504 21504
23552 23552
25600 25600
27648 27648
28672 28672
29696 29696
31744 31744
33792 33792
35840 35840
37376 37376
37888 37888
39936 39936
41984 41984
43392 43392
57344 57344
66560 66560
90112 90112
98304
131072
161792 161792
229376
262144
270336 270336
290912
294912
393216
397312 397312
443392 443392
458752
491520
497152 497152
589824
655360
786432
917504
1048576
1179648
1185792 1185792
1323008 1323008
1474560
1955840 1955840
2031616
2097152
2359296
2785280
3145728
3670016
3969024 3969024
4194304
4718592
5242880
7340032
7847936 7847936
|
Posted by Charlie
on 2022-10-18 11:04:12 |