OFFSET
1,1
COMMENTS
If A074741(n) is prime, then prime(n+1) is in this sequence. - Michel Marcus, Jan 12 2015
LINKS
Abhiram R Devesh, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1)=5; primes less than or equal to 5: [2, 3, 5]; squares of prime gaps: [1, 4]; sum of squares of prime gaps: 5.
a(2)=13; primes less than or equal to 13: [2, 3, 5, 7, 11, 13]; squares of prime gaps: [1, 4, 4, 16, 4]; sum of squares of prime gaps: 29.
PROG
(Python)
from sympy import nextprime, isprime
p = 2
s = 0
while s < 8000:
np = nextprime(p)
if isprime(s):
print(p)
d = np - p
s += d*d
p = np
(PARI) listp(nn) = {my(s = 0); my(precp = 2); forprime (p=3, nn, if (isprime(ns = (s + (p - precp)^2)), print1(p, ", ")); s = ns; precp = p; ); } \\ Michel Marcus, Jan 12 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Abhiram R Devesh, Nov 22 2014
STATUS
approved