Primes: n*2^m+1: Difference between revisions
Content added Content deleted
(J) |
|||
Line 516: | Line 516: | ||
44 1 89 |
44 1 89 |
||
45 2 181 </syntaxhighlight> |
45 2 181 </syntaxhighlight> |
||
(Most of the implementation here is about merging intermediate values and formatting for display. The calculation for m is <code>i.&1"1]1 p:1+(1+i.45) */ 2^i.9</code> -- for n in the range 1..45, try all m exponents in the range 0..8 and find the first m value for each n which corresponds to a prime.) |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |
||
<syntaxhighlight lang = "julia">""" Rosetta code task: rosettacode.org/wiki/Primes:_n*2%5Em%2B1 """ |
<syntaxhighlight lang = "julia">""" Rosetta code task: rosettacode.org/wiki/Primes:_n*2%5Em%2B1 """ |