Jump to content

Numbers with same digit set in base 10 and base 16: Difference between revisions

add Setl
(add Setl)
Line 1,623:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 53, 371, 913, 1040, 2080, 2339, 4100, 5141, 5412, 5441, 6182, 8200, 9241, 13593, 13665, 13969, 16406, 20530, 26946, 30979, 32803, 33638, 33840, 33841, 33842, 33843, 33844, 33845, 33846, 33847, 33848, 33849, 34883, 37943, 38931, 38966, 38995, 66310, 71444, 71497, 71511, 75120, 75121, 75122, 75123, 75124, 75125, 75126, 75127, 75128, 75129, 75621, 86150, 88165, 91465, 91769, 96617, 98711, 99481]
</pre>
 
=={{header|SETL}}==
<syntaxhighlight lang="setl">program Numbers_with_same_digit_set_in_base_10_and_base_16;
loop for i in [0..100000] | digitset(i,10) = digitset(i,16) do
nprint(lpad(str i, 8));
if (col +:= 1) mod 10 = 0 then print; end if;
end loop;
print;
 
proc digitset(n, b);
s := {};
loop until n=0 do
s with:= n mod b;
n div:= b;
end loop;
return s;
end proc;
end program;</syntaxhighlight>
{{out}}
<pre> 0 1 2 3 4 5 6 7 8 9
53 371 913 1040 2080 2339 4100 5141 5412 5441
6182 8200 9241 13593 13665 13969 16406 20530 26946 30979
32803 33638 33840 33841 33842 33843 33844 33845 33846 33847
33848 33849 34883 37943 38931 38966 38995 66310 71444 71497
71511 75120 75121 75122 75123 75124 75125 75126 75127 75128
75129 75621 86150 88165 91465 91769 96617 98711 99481</pre>
 
=={{header|Sidef}}==
2,125

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.