OFFSET
1,1
COMMENTS
The numbers prime(k)- 2 are a subsequence of A173960 (averages of four consecutive odd squares, or numbers of form 4*m^2+8*m+9), and also subsequence of A040976 (numbers prime(n) - 2). So, a(n) are the indices k such prime(k) are of the form 4*m^2+8*m+11 with the corresponding m = {1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 15, 16, 17, 18, 19, 23, 25, 28,...}.
The sequence A173960 and the subsequence prime(a(n)) - 2 appear in a diagonal straight line in the Ulam spiral (see the illustration).
LINKS
Michel Lagneau, Illustration
EXAMPLE
a(1) = 9 because prime(9) - 2 = 23 - 2 = 21, and (1^2 + 3^2 + 5^2 + 7^2)/4 = 21;
a(2) = 14 because prime(14) - 2 = 43 - 2 = 41, and (3^2 + 5^2 + 7^2 + 9^2)/4 = 41.
MAPLE
for n from 9 to 1000 do:
p:=ithprime(n)-2:
for m from 1 by 2 to p do:
s:=(m^2+(m+2)^2+(m+4)^2+(m+6)^2)/4:
if s=p then printf(`%d, `, n):else fi:
od:
od:
MATHEMATICA
PrimePi@ Select[(#^2 + (# + 2)^2 + (# + 4)^2 + (# + 6)^2)/4 &@ Range@ 210 + 2, PrimeQ] (* Michael De Vlieger, May 02 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, May 02 2016
STATUS
approved