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.

A130893 Lucas numbers (beginning with 1) mod 10.

Original entry on oeis.org

1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2, 1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2, 1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2, 1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2, 1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2, 1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2, 1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2, 1, 3, 4
Offset: 0

Views

Author

Philippe Lallouet (philip.lallouet(AT)wanadoo.fr), Aug 22 2007

Keywords

Comments

Period 12: repeat [1, 3, 4, 7, 1, 8, 9, 7, 6, 3, 9, 2].

Examples

			1 + 3 = 4 = 4 mod 10, then a(3) = 4.
3 + 4 = 7 = 7 mod 10, then a(4) = 7.
4 + 7 = 11 = 1 mod 10, then a(5) = 1.
		

Crossrefs

Programs

  • Magma
    [Lucas(n) mod 10: n in [1..100]]; // Vincenzo Librandi, Oct 01 2015
  • Mathematica
    Nest[Append[#, Mod[Total[Take[#, -2]], 10]] &, {1, 3}, 110]  (* Harvey P. Dale, Apr 05 2011 *)
    t = {1, 3}; Do[AppendTo[t, Mod[t[[-1]] + t[[-2]], 10]], {99}]; t (* T. D. Noe, Sep 16 2013 *)
    Mod[LucasL[Range[100]], 10] (* Alonso del Arte, Sep 30 2015 *)
    LinearRecurrence[{1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1}, {1, 3, 4, 7,
      1, 8, 9, 7, 6, 3, 9}, 100] (* G. C. Greubel, Feb 08 2016 *)
  • PARI
    a(n) = (fibonacci(n+1)+fibonacci(n-1)) % 10;
    vector(100, n, a(n)) \\ Altug Alkan, Sep 30 2015
    
  • Ruby
    def truncM10(n)
      a = 1
      b = 3
      n.times do
        a, b = (b % 10), ((a + b) % 10)
      end
      return b
    end
    # Joseph P. Shoulak, Sep 15 2013
    

Formula

a(n) = (a(n-2) + a(n-1)) mod 10, with a(0) = 1, a(1) = 3.
a(n) = A000204(n+1) mod 10 = A000032(n+1) mod 10. - Joerg Arndt, Sep 17 2013
a(n) = f(5(n-1)+2) mod 10, where f(n) is the n-th Fibonacci number (A000045). - Joseph P. Shoulak, Sep 15 2013
From G. C. Greubel, Feb 08 2016: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) - a(n-6) + a(n-7) - a(n-8) + a(n-9) - a(n-10) + a(n-11).
a(n+12) = a(n). (End)

Extensions

Corrected and extended by Harvey P. Dale, Apr 05 2011
New name from Joerg Arndt, Sep 17 2013