login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A083016
Rearrangement of primes such that the sum of two consecutive terms is a square.
4
2, 7, 29, 71, 73, 251, 5, 11, 53, 47, 17, 19, 557, 227, 97, 3, 13, 23, 41, 59, 137, 263, 61, 83, 113, 31, 293, 107, 37, 863, 433, 467, 109, 1187, 257, 67, 509, 167, 89, 311, 173, 151, 1613, 503, 281, 43, 101, 223, 353, 131, 193, 383, 401, 499, 797, 103, 1193, 571
OFFSET
1,1
COMMENTS
Bunyakovsky's conjecture implies that a(n) always exists. - Robert Israel, Dec 08 2019
LINKS
MAPLE
N:= 10^4: # to get all terms before the first term > N
Primes:= select(isprime, [seq(i, i=3..N, 2)]):
A[1]:= 2:
for n from 2 do
found:= false;
for k from 1 to nops(Primes) do
if issqr(A[n-1]+Primes[k]) then
A[n]:= Primes[k];
Primes:= subsop(k=NULL, Primes);
found:= true;
break
fi
od;
if not found then break fi
od:
seq(A[i], i=1..n-1); # Robert Israel, Dec 08 2019
PROG
(PARI) { PS(a)= v=vector(a); v[1]=1; k=prime(1); print1(k", "); while(1, t=0; for(s=1, a, r=prime(s); if(v[s]==0 && issquare(k+r), t=r; v[s]=1; break)); if(t==0, break); print1(r", "); k=r) }
CROSSREFS
Sequence in context: A339868 A181758 A285790 * A062064 A158024 A166940
KEYWORD
nonn
AUTHOR
Jason Earls, May 28 2003
STATUS
approved