login
A359582
a(n) is the least prime > a(n-2) such that a(n-1)+a(n) is a square.
1
2, 2, 7, 29, 71, 73, 251, 149, 751, 1013, 1103, 1201, 2399, 1697, 2659, 4397, 2999, 5101, 5303, 6361, 8039, 8861, 8563, 15773, 11783, 17117, 13159, 30941, 25703, 35801, 26699, 49477, 30047, 51749, 34687, 55313, 39551, 57793, 43331, 59069, 47207, 71129, 62827, 75557, 64319, 83137, 68963, 84701, 83399
OFFSET
1,1
COMMENTS
For n > 2, a(n) == (-1)^n (mod 4).
LINKS
Robert Israel, Plot of first differences a(n)-a(n-1), odd n in blue, even n in red
EXAMPLE
a(4) = 29 because a(3) + 29 = 6^2 is a square and 29 is the first prime greater than a(2) = 2 that works.
MAPLE
A[1]:= 2: A[2]:= 2: s:= 2:
for i from 3 to 100 do
for s from s+1 while not isprime(s^2 - A[i-1]) do od:
A[i]:= s^2 - A[i-1];
od:
seq(A[i], i=1..100);
CROSSREFS
Sequence in context: A138802 A292016 A350020 * A047003 A067352 A240978
KEYWORD
nonn,look
AUTHOR
Robert Israel, Jan 08 2023
STATUS
approved