Brilliant numbers: Difference between revisions
Content added Content deleted
(→{{header|Arturo}}: Added Algol 68) |
|||
Line 485: | Line 485: | ||
First >= 1000000000 is 7407841 in the series: 1000000081 |
First >= 1000000000 is 7407841 in the series: 1000000081 |
||
</pre> |
</pre> |
||
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
|||
<lang Mathematica>ClearAll[PrimesDecade] |
|||
PrimesDecade[n_Integer] := Module[{bounds}, |
|||
bounds = {PrimePi[10^n] + 1, PrimePi[10^(n + 1) - 1]}; |
|||
Prime[Range @@ bounds] |
|||
] |
|||
ds = Union @@ Table[Union[Times @@@ Tuples[PrimesDecade[d], 2]], {d, 0, 4}]; |
|||
Multicolumn[Take[ds, 100], {Automatic, 8}, Appearance -> "Horizontal"] |
|||
sel = Min /@ GatherBy[Select[ds, GreaterEqualThan[10]], IntegerLength]; |
|||
Grid[{#, FirstPosition[ds, #][[1]]} & /@ sel]</lang> |
|||
{{out}} |
|||
<pre>4 6 9 10 14 15 21 25 |
|||
35 49 121 143 169 187 209 221 |
|||
247 253 289 299 319 323 341 361 |
|||
377 391 403 407 437 451 473 481 |
|||
493 517 527 529 533 551 559 583 |
|||
589 611 629 649 667 671 689 697 |
|||
703 713 731 737 767 779 781 793 |
|||
799 803 817 841 851 869 871 893 |
|||
899 901 913 923 943 949 961 979 |
|||
989 1003 1007 1027 1037 1067 1073 1079 |
|||
1081 1121 1139 1147 1157 1159 1189 1207 |
|||
1219 1241 1247 1261 1271 1273 1333 1343 |
|||
1349 1357 1363 1369 |
|||
10 4 |
|||
121 11 |
|||
1003 74 |
|||
10201 242 |
|||
100013 2505 |
|||
1018081 10538 |
|||
10000043 124364 |
|||
100140049 573929 |
|||
1000000081 7407841</pre> |
|||
=={{header|Perl}}== |
=={{header|Perl}}== |