OFFSET
1,3
COMMENTS
Complement of A017101. - Michel Marcus, Sep 13 2015
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,1,-1).
FORMULA
G.f.: x^2*(x^6+x^5+x^4+x^3+2*x^2+x+1)/((x-1)^2*(x^6+x^5+x^4+x^3+x^2+x+1)). [Colin Barker, Jun 22 2012]
From Wesley Ivan Hurt, Sep 12 2015: (Start)
a(n) = a(n-1) + a(n-7) - a(n-8) for n>8.
a(n) = n + floor((n-4)/7). (End)
From Wesley Ivan Hurt, Jul 21 2016: (Start)
a(n) = a(n-7) + 8 for n>7.
a(n) = (56*n - 49 + (n mod 7) + ((n+1) mod 7) + ((n+2) mod 7) - 6*((n+3) mod 7) + ((n+4) mod 7) + ((n+5) mod 7) + ((n+6) mod 7))/49.
a(7*k) = 8*k-1, a(7*k-1) = 8*k-2, a(7*k-2) = 8*k-3, a(7*k-3) = 8*k-4, a(7*k-4) = 8*k-6, a(7*k-5) = 8*k-7, a(7*k-6) = 8*k-8. (End)
MAPLE
for n from 0 to 200 do if n mod 8 <> 3 then printf(`%d, `, n) fi: od:
MATHEMATICA
Table[n+Floor[(n-4)/7], {n, 100}] (* Wesley Ivan Hurt, Sep 12 2015 *)
LinearRecurrence[{1, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 2, 4, 5, 6, 7, 8}, 80] (* Vincenzo Librandi, Sep 13 2015 *)
DeleteCases[Range[0, 100], _?(Mod[#, 8]==3&)] (* Harvey P. Dale, Oct 05 2020 *)
PROG
(Magma) [n+Floor((n-4)/7) : n in [1..100]]; // Wesley Ivan Hurt, Sep 12 2015
(Magma) I:=[0, 1, 2, 4, 5, 6, 7, 8]; [n le 8 select I[n] else Self(n-1) + Self(n-7) - Self(n-8): n in [1..80]]; // Vincenzo Librandi, Sep 13 2015
(Python)
def A047573(n):
a, b = divmod(n-1, 7)
return (0, 1, 2, 4, 5, 6, 7)[b]+(a<<3) # Chai Wah Wu, Jan 27 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from James A. Sellers, Feb 19 2001
STATUS
approved