OFFSET
2,1
COMMENTS
a(n) is prime for n in A240749. - Robert Israel, Jul 06 2017
If p and q are primes such that p > q > 3, then ((p^2 - q^2)/2, p*q, (p^2 + q^2)/2) is a primitive Pythagorean triple. - César Aguilera, Jun 02 2022
LINKS
Zak Seidov, Table of n, a(n) for n = 2..10001
FORMULA
EXAMPLE
a(2)=17 because (prime(3)^2 + prime(2)^2)/2 = (5^2 + 3^2)/2 = 17.
MAPLE
seq((ithprime(i)^2 + ithprime(i+1)^2)/2, i=2..100); # Robert Israel, Jul 06 2017
MATHEMATICA
Table[(Prime[n + 1]^2 + Prime[n]^2)/2, {n, 2, 50}] (* Vincenzo Librandi, Mar 07 2015 *)
p=2; q=3; Table[p=q; q=NextPrime[q]; (q^2+p^2)/2, {100}] (* Zak Seidov, Jul 06 2017 *)
PROG
(PARI) a(n) = (prime(n+1)^2+prime(n)^2)/2; \\ Michel Marcus, Oct 03 2013
(Magma) [(NthPrime(n+1)^2+NthPrime(n)^2)/2: n in [2..50]]; // Vincenzo Librandi, Mar 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Oct 17 2002
STATUS
approved