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.

A070471 a(n) = n^3 mod 5.

Original entry on oeis.org

0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0, 1, 3, 2, 4, 0
Offset: 0

Views

Author

N. J. A. Sloane, May 12 2002

Keywords

Comments

Decimal expansion of 1324/99999. - Vincenzo Librandi, Dec 09 2010

Crossrefs

Cf. A010874.

Programs

  • Mathematica
    CoefficientList[Series[-x (1 + 3 x + 2 x^2 + 4 x^3)/((x - 1) (1 + x + x^2 + x^3 + x^4)), {x, 0, 100}], x] (* Vincenzo Librandi, May 21 2014 *)
    PowerMod[Range[0, 100], 3, 5] (* G. C. Greubel, Mar 26 2016 *)
    Table[If[Mod[n, 5] == 0, 0, ModularInverse[n, 5]], {n, 0, 100}] (* Jean-François Alcover, May 03 2017 *)
  • PARI
    my(x='x+O('x^99)); concat(0, Vec(-x*(1+3*x+2*x^2+4*x^3)/((x-1)*(1+x+x^2+x^3+x^4)))) \\ Altug Alkan, Mar 27 2016
    
  • PARI
    a(n) = lift(Mod(n, 5)^3); \\ Michel Marcus, Jun 03 2025
  • Sage
    [power_mod(n,3,5) for n in (0..101)] # Zerinvary Lajos, Oct 29 2009
    

Formula

a(n) = n^7 mod 5 since 7 == 3 (mod 5-1).
G.f.: -x*(1+3*x+2*x^2+4*x^3) / ( (x-1)*(1+x+x^2+x^3+x^4) ). - R. J. Mathar, Dec 10 2010
a(n) = a(n-5). - G. C. Greubel, Mar 26 2016
a(n) = 10 - Sum_{k=1..4} a(n-k) for n > 3. - Nicolas Bělohoubek, Jun 03 2025