OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
v:= 1: p:= 0: q:= 0: np:= 0: R:= NULL:
for i from 1 while np < 100 do
if isprime(v) then p:= p+1; R:= R, i; np:= np+1 else q:= q+1 fi;
v:= p^2 + q^2 + 1;
od:
R;
MATHEMATICA
s={}; t= {1}; (* t is A194627 *) Do[ps = Count[t, _?(PrimeQ[#] &)]; AppendTo[t, ps^2 + (n - ps - 1)^2 + 1]; If[PrimeQ[t[[-1]] ], AppendTo[s, n]], {n, 2, 1241}]; s (* James C. McMahon, Nov 12 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Nov 10 2024
STATUS
approved