Super-Poulet numbers: Difference between revisions
m
Meh, fix case errors
Thundergnat (talk | contribs) m (Thundergnat moved page Super-Poulet number to Super-Poulet numbers: Should be plural) |
Thundergnat (talk | contribs) m (Meh, fix case errors) |
||
Line 1:
{{draft task}}
A [[wp:Super-Poulet_number|
;Task
* Find and display the first '''20'''
;Stretch
* Find and display the index and value of the first
;See also
;*[[Fermat pseudoprimes|Task: Fermat pseudoprimes]]
;*[[wp:Super-Poulet_number|Wikipedia:
;*[[oeis:A050217|OEIS:A050217 -
Line 25:
my @super-poulet = @poulet.grep: { all .&divisors.skip(1).map: { 2 == expmod 2, $_, $_ } }
say "First 20
for 1e6.Int, 1e7.Int -> $threshold {
say "\nIndex and value of first
my $index = @super-poulet.first: * > $threshold, :k;
say "{(1+$index).&ordinal-digit}
}</lang>
{{out}}
<pre>First 20
(341 1387 2047 2701 3277 4033 4369 4681 5461 7957 8321 10261 13747 14491 15709 18721 19951 23377 31417 31609)
Index and value of first
109th
Index and value of first
317th
</pre>
|