OFFSET
2,1
COMMENTS
Unlike the average of four successive primes, the average of four successive primes squared is integer for all n>=2. [corrected by Zak Seidov, Jul 07 2017]
LINKS
Harvey P. Dale, Table of n, a(n) for n = 2..1000
FORMULA
a(n) = (prime(n)^2 + prime(n+1)^2 + prime(n+2)^2 + prime(n+3)^2)/4, n>=2.
EXAMPLE
a(2)=51 because (prime(2)^2 + prime(3)^2 + prime(4)^2 + prime(5)^2)/4 = (3^2 + 5^2 + 7^2 + 11^2)/4 = 51.
MATHEMATICA
Mean[#]&/@(Partition[Prime[Range[2, 50]], 4, 1]^2) (* Harvey P. Dale, Dec 14 2011 *)
Table[(Prime[n]^2 + Prime[n+1]^2 + Prime[n+2]^2 + Prime[n+3]^2)/4, {n, 2, 50}] (* Vincenzo Librandi, Jul 07 2017 *)
PROG
(Magma) [(NthPrime(n)^2+NthPrime(n+1)^2+NthPrime(n+2)^2+ NthPrime(n+3)^2)/4: n in [2..50]]; // Vincenzo Librandi, Jul 07 2017
(PARI) a(n, p=prime(n))=my(q=nextprime(p+1), r=nextprime(q+1), s=nextprime(r+1)); norml2([p, q, r, s])/4 \\ Charles R Greathouse IV, Jul 07 2017
(PARI) first(n)=my(p=primes(n+3)); vector(n-1, i, (p[i+1]^2 + p[i+2]^2 + p[i+3]^2 + p[i+4]^2)/4) \\ Charles R Greathouse IV, Jul 07 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Zak Seidov, Oct 17 2002
STATUS
approved