login
A112987
a(n) = 2^(2^n mod n) for n > 0; a(0) = 2.
3
2, 1, 1, 4, 1, 4, 16, 4, 1, 256, 16, 4, 16, 4, 16, 256, 1, 4, 1024, 4, 65536, 256, 16, 4, 65536, 128, 16, 67108864, 65536, 4, 16, 4, 1, 256, 16, 262144, 268435456, 4, 16, 256, 65536, 4, 4194304, 4, 65536, 131072, 16, 4, 65536, 1073741824, 16777216, 256
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
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
Cf. A015910.
Sequence in context: A344529 A144389 A136321 * A125138 A372647 A375023
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Oct 08 2005
EXTENSIONS
Name edited by M. F. Hasler, Nov 09 2018
STATUS
approved