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.

A047497 Numbers that are congruent to {1, 2, 4, 5, 7} mod 8.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 10, 12, 13, 15, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 34, 36, 37, 39, 41, 42, 44, 45, 47, 49, 50, 52, 53, 55, 57, 58, 60, 61, 63, 65, 66, 68, 69, 71, 73, 74, 76, 77, 79, 81, 82, 84, 85, 87, 89, 90, 92, 93, 95, 97, 98, 100, 101, 103
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A047399 (complement).

Programs

  • Magma
    I:=[1,2,4,5,7]; [n le 5 select I[n] else Self(n-5) + 8 : n in [1..70]]; // Vincenzo Librandi, Jun 06 2017
  • Maple
    seq(floor((8*n-3)/5),n=1..56); # Gary Detlefs, Mar 07 2010
  • Mathematica
    Select[Range[120],MemberQ[{1,2,4,5,7},Mod[#,8]]&] (* or *) LinearRecurrence[ {1,0,0,0,1,-1},{1,2,4,5,7,9},100] (* Harvey P. Dale, Jun 05 2017 *)
    Table[8 n + {1, 2, 4, 5, 7}, {n, 0, 20}]//Flatten (* Vincenzo Librandi, Jun 06 2017 *)
  • PARI
    for (n=1, 80, print1((8*n-3)\5, ", ")) \\ Michel Marcus, Sep 10 2014
    

Formula

a(n) = floor((8n-3)/5). [Gary Detlefs, Mar 07 2010]
From R. J. Mathar, Mar 23 2010: (Start)
a(n) = a(n-1) + a(n-5) - a(n-6).
G.f.: x*(1 + x + 2*x^2 + x^3 + 2*x^4 + x^5)/ ((x^4 + x^3 + x^2 + x + 1) * (x-1)^2). (End)