OFFSET
1,1
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000
EXAMPLE
p = 218453 is the first prime so that 3*p+1 = 655360 = (2^18)*5 has 18 as exponent of 2 in 3p+1, thus a(18) = 218453.
MAPLE
f:= proc(n)
local m, t, p;
t:= 2^n;
for m from 1 + 4*(n mod 2) by 6 do
p:= (t*m-1)/3;
if isprime(p) then return p fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Nov 18 2017
MATHEMATICA
a[n_] := Module[{m, t = 2^n, p}, For[m = 1 + 4 Mod[n, 2], True, m += 6, p = (t m - 1)/3; If[PrimeQ[p], Return[p]]]];
Array[a, 100] (* Jean-François Alcover, Aug 28 2020, after Robert Israel *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Sep 18 2003
EXTENSIONS
More terms from Ray Chandler, Sep 21 2003
STATUS
approved