OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..5000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
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)
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 *)
PROG
(PARI) for (n=1, 80, print1((8*n-3)\5, ", ")) \\ Michel Marcus, Sep 10 2014
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved