OFFSET
1,3
COMMENTS
Also, numbers whose binary expansion does not end in 101.
Numbers that are congruent to {0, 1, 2, 3, 4, 6, 7} mod 8. - Wesley Ivan Hurt, Jul 22 2016
LINKS
Daniel Starodubtsev, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,1,-1).
FORMULA
Numbers that are congruent to {0, 1, 2, 3, 4, 6, 7} mod 8.
G.f.: x^2*(1+x+x^2+x^3+2*x^4+x^5+x^6) / ((x^6+x^5+x^4+x^3+x^2+x+1)*(x-1)^2). - R. J. Mathar, Oct 25 2011
a(n) = n + floor((n-6)/7). - M. F. Hasler, Nov 02 2013
From Wesley Ivan Hurt, Jul 22 2016: (Start)
a(n) = a(n-1) + a(n-7) - a(n-8) for n>8; a(n) = a(n-7) + 8 for n>7.
a(n) = (56*n - 63 + (n mod 7) - 6*((n+1) mod 7) + ((n+2) mod 7) + ((n+3) mod 7) + ((n+4) mod 7) + ((n+5) mod 7) + ((n+6) mod 7))/49.
a(7k) = 8k-1, a(7k-1) = 8k-2, a(7k-2) = 8k-4, a(7k-3) = 8k-5, a(7k-4) = 8k-6, a(7k-5) = 8k-7, a(7k-6) = 8k-8. (End)
MAPLE
A004776:=n->8*floor(n/7)+[0, 1, 2, 3, 4, 6, 7][(n mod 7)+1]: seq(A004776(n), n=0..100); # Wesley Ivan Hurt, Jul 22 2016
MATHEMATICA
DeleteCases[Range[0, 80], _?(Mod[#, 8]==5&)] (* Harvey P. Dale, Apr 28 2014 *)
PROG
(Haskell)
a004776 n = a004776_list !! (n-1)
a004776_list = filter ((/= 5) . (`mod` 8)) [0..]
-- Reinhard Zumkeller, Aug 17 2012
(PARI) is(n)=n%8!=5 \\ Charles R Greathouse IV, Mar 07 2013
(PARI) A004776(n)=n+(n-6)\7 \\ M. F. Hasler, Nov 02 2013
(Magma) [n : n in [0..100] | n mod 8 in [0, 1, 2, 3, 4, 6, 7]]; // Wesley Ivan Hurt, Jul 22 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by M. F. Hasler, Nov 02 2013
STATUS
approved