login
A137326
a(n) = sqrt(A139033(n)).
3
1, 2, 6, 24, 36, 42, 48, 66, 78, 126, 138, 144, 162, 210, 264, 276, 288, 294, 336, 390, 420, 462, 498, 504, 510, 534, 540, 570, 618, 630, 642, 660, 690, 702, 744, 780, 840, 882, 906, 984, 1002, 1008, 1020, 1044, 1050, 1086, 1140, 1176, 1188, 1278, 1290, 1308
OFFSET
1,2
MAPLE
s:= proc(n) option remember; `if`(n<1, 0, a(n)^2+s(n-1)) end:
a:= proc(n) option remember; local k, m;
k:= s(n-1); for m from 1+a(n-1)
while not isprime(k+m^2) do od; m
end: a(1):=1:
seq(a(n), n=1..52); # Alois P. Heinz, Jan 26 2023
MATHEMATICA
s[n_] := s[n] = If[n < 1, 0, a[n]^2 + s[n-1]];
a[n_] := a[n] = Module[{k, m}, k = s[n-1]; For[m = 1 + a[n-1], !PrimeQ[k + m^2], m++]; m];
a[1] = 1;
Table[a[n], {n, 1, 52}] (* Jean-François Alcover, Feb 12 2023, after Alois P. Heinz *)
CROSSREFS
Cf. A139033.
Sequence in context: A158977 A165823 A263690 * A163912 A257546 A274038
KEYWORD
nonn
AUTHOR
Zak Seidov, Apr 07 2008
STATUS
approved