OFFSET
1,1
FORMULA
a(n) = A036689(n+1) + A001223(n). - Michel Marcus, Aug 21 2015 [Corrected by Georg Fischer, Dec 12 2022]
a(n) ~ n^2 log^2 n. - Charles R Greathouse IV, Aug 22 2015
EXAMPLE
a(2) = 5^2 - 3 = 22.
MATHEMATICA
Table[Prime[n + 1]^2 - Prime[n], {n, 60}] (* Vincenzo Librandi, Aug 20 2015 *)
PROG
(PARI) first(m)=vector(m, i, prime(i+1)^2 - prime(i)) \\ Anders Hellström, Aug 20 2015
(PARI) a(n, p=prime(n)); nextprime(p+1)^2-p \\ Charles R Greathouse IV, Aug 22 2015
(PARI) first(n)=my(v=primes(n+1)); vector(n, i, v[i+1]^2-v[i]) \\ Charles R Greathouse IV, Aug 22 2015
(Magma) [NthPrime(n+1)^2-NthPrime(n): n in [1.. 70]]; // Vincenzo Librandi, Aug 20 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Aug 20 2015
STATUS
approved