OFFSET
3,2
COMMENTS
For n>=3, prime(n+1)^2-prime(n)^2 is always divisible by 24.
It follows from the previous comment that for n>=3, prime(n)= sqrt(5^2 + k*24) where integer k>= 0 Then it follows from above that for n>=3, ((prime(n))^2 - 1)/24 always gives integral values - see A024702. [From Alexander R. Povolotsky, Sep 20 2008]
LINKS
G. C. Greubel, Table of n, a(n) for n = 3..1000
FORMULA
a(n) = (prime(n+1)^2 - prime(n)^2)/24.
EXAMPLE
a(4)=3 because (prime(5)^2-prime(4)^2)/24=(11^2-7^2)/24=3.
MATHEMATICA
(#[[2]]-#[[1]])/24&/@(Partition[Prime[Range[3, 70]], 2, 1]^2) (* Harvey P. Dale, Apr 06 2013 *)
Table[(Prime[n + 1]^2 - Prime[n]^2)/24, {n, 3, 50}] (* G. C. Greubel, Feb 18 2017 *)
PROG
(PARI) j=[]; for(n=3, 300, if(((floor((((prime(n+1))^2)-((prime(n))^2))/24))==(ceil(((((prime(n+1))^2)-((prime(n))^2))/24)))), j=concat(j, ((((prime(n+1))^2) - ((prime(n))^2))/24)), j=concat(j, -1))); j \\ Alexander R. Povolotsky, Sep 08 2008
(Magma) [(NthPrime(n+1)^2 - NthPrime(n)^2)/24: n in [3..100]]; // Vincenzo Librandi, Mar 07 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Zak Seidov, Oct 17 2002
STATUS
approved