cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A112987 a(n) = 2^(2^n mod n) for n > 0; a(0) = 2.

Original entry on oeis.org

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

Views

Author

Paul Barry, Oct 08 2005

Keywords

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

Crossrefs

Cf. A015910.

Programs

  • Magma
    [2] cat [2^Modexp(2, n, n): n in [1..60]]; // Vincenzo Librandi, Nov 09 2018
  • Mathematica
    Join[{2}, 2^Table[PowerMod[2, n, n], {n, 85}]] (* Vincenzo Librandi, Nov 09 2018 *)
  • PARI
    apply( A112987(n)=2^lift(if(n,Mod(2,n))^n), [0..50]) \\ M. F. Hasler, Nov 09 2018
    

Formula

a(n) = 2^A015910(n) for n > 0. [Corrected by M. F. Hasler, Nov 09 2018]

Extensions

Name edited by M. F. Hasler, Nov 09 2018