OFFSET
0,1
COMMENTS
The definition of a(0) is motivated by the idea that (anything)^n = 1 for n = 0. We also get this if "mod n" is replaced by "in Z/nZ", for n = 0. - M. F. Hasler, Nov 09 2018
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = 2^A015910(n) for n > 0. [Corrected by M. F. Hasler, Nov 09 2018]
MATHEMATICA
Join[{2}, 2^Table[PowerMod[2, n, n], {n, 85}]] (* Vincenzo Librandi, Nov 09 2018 *)
PROG
(PARI) apply( A112987(n)=2^lift(if(n, Mod(2, n))^n), [0..50]) \\ M. F. Hasler, Nov 09 2018
(Magma) [2] cat [2^Modexp(2, n, n): n in [1..60]]; // Vincenzo Librandi, Nov 09 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Oct 08 2005
EXTENSIONS
Name edited by M. F. Hasler, Nov 09 2018
STATUS
approved