Smallest number k such that k+2^m is composite for all m less than k: Difference between revisions
Smallest number k such that k+2^m is composite for all m less than k (view source)
Revision as of 23:12, 12 January 2022
, 2 years agojulia example
SqrtNegInf (talk | contribs) (Added Perl) |
m (julia example) |
||
Line 25:
[[oeis:A033919|OEIS:A033939 - Odd k for which k+2^m is composite for all m < k]]
=={{header|Julia}}==
<lang julia>using Lazy
using Primes
a(k) = all(m -> !isprime(k + big"2"^m), 1:k-1)
A033939 = @>> Lazy.range(2) filter(isodd) filter(a)
println(take(5, A033939)) # List: (773 2131 2491 4471 5101)
</lang>
=={{header|Perl}}==
|