login
A357373
a(n) is the first prime p such that (p+q)/(2*n) is the square of a prime, where q is the next prime after p.
2
3, 17, 11, 47521, 43, 149, 26041, 71, 79, 3607, 97, 107, 6871, 53, 59, 61, 31397, 71, 73, 179, 2539, 197, 2777, 599, 223, 647, 107, 61843, 1520777, 113, 277, 283, 823, 5743, 313, 139, 254887, 337, 349, 157, 75797, 1049, 5197, 173, 179, 409, 2297, 191, 439, 6047, 457, 892357, 8951, 242399, 491
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 11 because (11+13)/(2*3) = 4 = 2^2 where 2 is prime, and 11 is the first prime that works.
MAPLE
f:= proc(n) local r, v, p, q;
r:= 1:
do
r:= nextprime(r);
v:= n*r^2;
p:= prevprime(v);
if 2*v-p = nextprime(v) then return p fi
od
end proc:
map(f, [$1..100]);
MATHEMATICA
f[n_] := Module[{r, v, p, q}, r = 1; While[True, r = NextPrime[r]; v = n*r^2; p = NextPrime[v, -1]; If[2*v - p == NextPrime[v], Return[p]]]];
Table[f[n], {n, 1, 100}] (* Jean-François Alcover, Oct 16 2022, after Robert Israel *)
CROSSREFS
Sequence in context: A033467 A096475 A088122 * A273702 A273710 A087964
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 25 2022
STATUS
approved