Super-d numbers: Difference between revisions

Content added Content deleted
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 26: Line 26:
:* '''[http://mathworld.wolfram.com/Super-dNumber.html Wolfram MathWorld - Super-d Number]'''
:* '''[http://mathworld.wolfram.com/Super-dNumber.html Wolfram MathWorld - Super-d Number]'''
:* '''[http://oeis.org/A014569 OEIS: A014569 - Super-3 Numbers]'''
:* '''[http://oeis.org/A014569 OEIS: A014569 - Super-3 Numbers]'''



=={{header|D}}==
=={{header|D}}==
Line 550: Line 549:
First 10 super-6 numbers:
First 10 super-6 numbers:
27257 272570 302693 323576 364509 502785 513675 537771 676657 678146</pre>
27257 272570 302693 323576 364509 502785 513675 537771 676657 678146</pre>

=={{header|Perl 6}}==
{{works with|Rakudo|2019.07.1}}
2 - 6 take a few seconds, 7 about 17 seconds, 8 about 90... 9, bleh... around 700 seconds.

<lang perl6>sub super (\d) {
my \run = d x d;
^∞ .hyper.grep: -> \n { (d * n ** d).Str.contains: run }
}

(2..9).race(:1batch).map: {
my $now = now;
put "\nFirst 10 super-$_ numbers:\n{.&super[^10]}\n{(now - $now).round(.1)} sec."
}</lang>

<pre>First 10 super-2 numbers:
19 31 69 81 105 106 107 119 127 131
0.1 sec.

First 10 super-3 numbers:
261 462 471 481 558 753 1036 1046 1471 1645
0.1 sec.

First 10 super-4 numbers:
1168 4972 7423 7752 8431 10267 11317 11487 11549 11680
0.3 sec.

First 10 super-5 numbers:
4602 5517 7539 12955 14555 20137 20379 26629 32767 35689
0.6 sec.

First 10 super-6 numbers:
27257 272570 302693 323576 364509 502785 513675 537771 676657 678146
5.2 sec.

First 10 super-7 numbers:
140997 490996 1184321 1259609 1409970 1783166 1886654 1977538 2457756 2714763
17.1 sec.

First 10 super-8 numbers:
185423 641519 1551728 1854230 6415190 12043464 12147605 15517280 16561735 18542300
92.1 sec.

First 10 super-9 numbers:
17546133 32613656 93568867 107225764 109255734 113315082 121251742 175461330 180917907 182557181
704.7 sec.</pre>


=={{header|Phix}}==
=={{header|Phix}}==
Line 680: Line 633:
7: 140997, 490996, 1184321, 1259609, 1409970, 1783166, 1886654, 1977538, 2457756, 2714763
7: 140997, 490996, 1184321, 1259609, 1409970, 1783166, 1886654, 1977538, 2457756, 2714763
8: 185423, 641519, 1551728, 1854230, 6415190, 12043464, 12147605, 15517280, 16561735, 18542300</pre>
8: 185423, 641519, 1551728, 1854230, 6415190, 12043464, 12147605, 15517280, 16561735, 18542300</pre>

=={{header|Raku}}==
(formerly Perl 6)
{{works with|Rakudo|2019.07.1}}
2 - 6 take a few seconds, 7 about 17 seconds, 8 about 90... 9, bleh... around 700 seconds.

<lang perl6>sub super (\d) {
my \run = d x d;
^∞ .hyper.grep: -> \n { (d * n ** d).Str.contains: run }
}

(2..9).race(:1batch).map: {
my $now = now;
put "\nFirst 10 super-$_ numbers:\n{.&super[^10]}\n{(now - $now).round(.1)} sec."
}</lang>

<pre>First 10 super-2 numbers:
19 31 69 81 105 106 107 119 127 131
0.1 sec.

First 10 super-3 numbers:
261 462 471 481 558 753 1036 1046 1471 1645
0.1 sec.

First 10 super-4 numbers:
1168 4972 7423 7752 8431 10267 11317 11487 11549 11680
0.3 sec.

First 10 super-5 numbers:
4602 5517 7539 12955 14555 20137 20379 26629 32767 35689
0.6 sec.

First 10 super-6 numbers:
27257 272570 302693 323576 364509 502785 513675 537771 676657 678146
5.2 sec.

First 10 super-7 numbers:
140997 490996 1184321 1259609 1409970 1783166 1886654 1977538 2457756 2714763
17.1 sec.

First 10 super-8 numbers:
185423 641519 1551728 1854230 6415190 12043464 12147605 15517280 16561735 18542300
92.1 sec.

First 10 super-9 numbers:
17546133 32613656 93568867 107225764 109255734 113315082 121251742 175461330 180917907 182557181
704.7 sec.</pre>


=={{header|REXX}}==
=={{header|REXX}}==