Smarandache-Wellin primes: Difference between revisions

Content added Content deleted
m (→‎{{header|Raku}}: Add a Raku example)
m (→‎{{header|Raku}}: Whoops, overlooked zero)
Line 39: Line 39:
sink @Smarandache-Whellen[1500]; # pre-reify for concurrency
sink @Smarandache-Whellen[1500]; # pre-reify for concurrency


sub derived ($n) { my %digits = $n.comb.Bag; (1..9).map({ %digits{$_} // 0 }).join }
sub derived ($n) { my %digits = $n.comb.Bag; (0..9).map({ %digits{$_} // 0 }).join }


sub abbr ($_) { .chars < 41 ?? $_ !! .substr(0,20) ~ '…' ~ .substr(*-20) ~ " ({.chars} digits)" }
sub abbr ($_) { .chars < 41 ?? $_ !! .substr(0,20) ~ '…' ~ .substr(*-20) ~ " ({.chars} digits)" }
Line 67: Line 67:


Smarandache-Whellen derived primes:
Smarandache-Whellen derived primes:
Index: 64, 45232857623519
Index: 31, 4194123321127
Index: 73, 47234179728521
Index: 71, 547233879626521
Index: 101, 55265428181036833
Index: 72, 547233979727521
Index: 108, 56265628251240937
Index: 133, 13672766322929571043
Index: 110, 57265628251441937
Index: 224, 3916856106393739943689
Index: 112, 59265728251642937
Index: 302, 462696313560586013558131
Index: 122, 63266131272746939
Index: 308, 532727113760586013758133
Index: 153, 723172323232702949
Index: 362, 6430314317473636515467149
Index: 208, 1465092363737883583
Index: 461, 8734722823685889120488197
Index: 230, 17557110463939953691
Index: 489, 9035923128899919621189209</pre>
</pre>



=={{header|Wren}}==
=={{header|Wren}}==