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.

A070347 a(n) = 2^n mod 21.

Original entry on oeis.org

1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11, 1, 2, 4, 8, 16, 11
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Programs

  • GAP
    List([0..83],n->PowerMod(2,n,21)); # Muniru A Asiru, Jan 31 2019
  • Mathematica
    PowerMod[2, Range[0, 50], 21] (* G. C. Greubel, Mar 11 2016 *)
    LinearRecurrence[{1,-1,1,-1,1},{1,2,4,8,16},120] (* or *) PadRight[{},120,{1,2,4,8,16,11}] (* Harvey P. Dale, Mar 19 2016 *)
  • PARI
    a(n)=lift(Mod(2,21)^n) \\ Charles R Greathouse IV, Mar 22 2016
    
  • Sage
    [power_mod(2,n,21)for n in range(0,90)] # Zerinvary Lajos, Nov 03 2009
    

Formula

From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5).
G.f.: (1 + x + 3*x^2 + 5*x^3 + 11*x^4)/ ((1-x) * (1+x+x^2) * (1-x+x^2)). (End)
a(n) = a(n-6). - G. C. Greubel, Mar 11 2016