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.

A112983 a(n) = 2^(n+1) mod n.

Original entry on oeis.org

0, 0, 1, 0, 4, 2, 4, 0, 7, 8, 4, 8, 4, 8, 1, 0, 4, 2, 4, 12, 16, 8, 4, 8, 14, 8, 25, 4, 4, 8, 4, 0, 16, 8, 1, 20, 4, 8, 16, 32, 4, 2, 4, 32, 34, 8, 4, 32, 11, 48, 16, 32, 4, 2, 31, 8, 16, 8, 4, 32, 4, 8, 16, 0, 64, 62, 4, 32, 16, 18, 4, 56, 4, 8, 61, 32, 36, 50, 4
Offset: 1

Views

Author

Paul Barry, Oct 08 2005

Keywords

Examples

			a(3) = 2^4 mod 3 = 16 mod 3 = 1.
		

Crossrefs

Programs

  • Magma
    [Modexp(2,n+1,n): n in [1..120]]; // G. C. Greubel, Jan 11 2023
    
  • Mathematica
    Table[PowerMod[2, n + 1, n], {n, 100}] (* T. D. Noe, Aug 13 2012 *)
  • Python
    print([2**(n+1) % n for n in range(1,77)])
    # Alex Ratushnyak, Aug 12 2012
    
  • SageMath
    [power_mod(2,n+1,n) for n in range(1,120)] # G. C. Greubel, Jan 11 2023

Formula

a(n) = A106262(2*n-1, n-2). - G. C. Greubel, Jan 11 2023

Extensions

Name, data and offset corrected by Alex Ratushnyak, Aug 12 2012