A286682 a(n) = A059784(n+1) - A059784(n)^2.
1, 4, 12, 4, 22, 12, 114, 4, 138, 142, 2956, 6388, 5248, 17532, 96930, 83782, 1464, 897448, 300832, 26908
Offset: 1
Examples
A059784(8) by construction can be written ((((((2^2 + 1)^2 + 4)^2 + 12)^2 + 4)^2 + 22)^2 + 12)^2 + 114. Taking out the addends gives 1, 4, 12, 4, 22, 12, 114 which lists the first seven terms of this sequence.
Programs
-
Mathematica
Map[#2 - #1^2 & @@ # &, Partition[NestList[NextPrime[#^2] &, 2, 12], 2, 1]] (* Michael De Vlieger, May 12 2017 *)
-
PARI
p=2;while(1,a=nextprime(p^2);print1(a-p^2,", ");p=a)
Extensions
a(14)-a(17) from Serge Batalov, May 26 2024
a(18)-a(20) from Serge Batalov, May 27 2024
Comments