OFFSET
2,3
COMMENTS
a(n+1) = n-th prime gap squared mod the n-th prime = A076821(n) mod A000040(n). Probably a(n) = A076821(n+1) for n > 31. This holds up to 4 * 10^18. - Charles R Greathouse IV, Apr 17 2012
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 2..10000
EXAMPLE
To get a(4): square the fourth prime to get 7^2 = 49. The remainder when this is divided by the third prime, 5, is 4. So a(3) = 4.
MAPLE
MATHEMATICA
Table[Mod[Prime[n+1]^2, Prime[n]], {n, 5!}] (* Vladimir Joseph Stephan Orlovsky, Apr 26 2010 *)
Table[PowerMod[Prime[n], 2, Prime[n-1]], {n, 2, 70}] (* Harvey P. Dale, Mar 22 2012 *)
PROG
(PARI) a(n)=prime(n)^2%prime(n-1) \\ Charles R Greathouse IV, Apr 17 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Neil Fernandez, May 01 2000
STATUS
approved