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.

A070472 a(n) = n^3 mod 7.

Original entry on oeis.org

0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1, 6, 1, 6, 6, 0, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Periodic with period 7.

Programs

  • Magma
    [Modexp(n, 3, 7 ): n in [0..100]]; // Vincenzo Librandi, Mar 27 2016
    
  • Mathematica
    PowerMod[Range[0,120],3,7] (* or *) LinearRecurrence[{0,0,0,0,0,0,1},{0,1,1,6,1,6,6},120] (* or *) PadRight[{},120,{0,1,1,6,1,6,6}] (* Harvey P. Dale, Nov 29 2013 *)
  • PARI
    a(n)=n^3%7 \\ Charles R Greathouse IV, Apr 06 2016
  • Sage
    [power_mod(n,3,7 ) for n in range(0, 101)] # Zerinvary Lajos, Oct 29 2009
    

Formula

a(n) = a(n-7).
G.f.: x*(1 + x + 6*x^2 + x^3 + 6*x^4 + 6*x^5)/(1-x^7). - Vincenzo Librandi, Mar 27 2016