OFFSET
1,3
COMMENTS
Numbers less than 8 or not congruent to 3 (mod 8). - M. F. Hasler, Nov 02 2013
Numbers that are congruent to {0, 1, 2, 4, 5, 6, 7} mod 8 including the number "3". - 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
For all n>4, a(n) = n + floor((n-12)/7); for n<12, a(n) = n-1. - M. F. Hasler, Nov 02 2013
From Wesley Ivan Hurt, Jul 22 2016: (Start)
G.f.: x^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^10)/(1 - x - x^7 + x^8).
a(n) = a(n-1) + a(n-7) - a(n-8) for n>12; a(n) = a(n-7) + 8 for n>11.
a(n) = (56*n - 105 + (n mod 7) + ((n+1) mod 7) - 6*((n+2) mod 7) + ((n+3) mod 7) + ((n+4) mod 7) + ((n+5) mod 7) + ((n+6) mod 7))/49 for n>4. (End)
a(1) = 0, a(2) = 1, a(3) = 2, a(4) = 3, a(7*n + k + 4) = 8*n + k + 3, n >= 0, 1 <= k < 8. - Yosu Yurramendi, Aug 09 2016
EXAMPLE
9 is 1001 in binary, which ends 001, not 011, so 9 is in the sequence. 19 is 10011 in binary, which ends 011, so 19 is not in the sequence. - Michael B. Porter, Jul 22 2016
MAPLE
A004775:=n->8*floor(n/7)+[0, 1, 2, 4, 5, 6, 7][(n mod 7)+1]: 0, 1, 2, 3, seq(A004775(n), n=3..100); # Wesley Ivan Hurt, Jul 22 2016
MATHEMATICA
Join[{0, 1, 2, 3}, Select[Range[3, 150], MemberQ[{0, 1, 2, 4, 5, 6, 7}, Mod[#, 8]] &]] (* Wesley Ivan Hurt, Jul 22 2016 *)
PROG
(PARI) is(n)=n%8!=3 || n==3 \\ Charles R Greathouse IV, Mar 29 2013
(PARI) A004775(n)=n+(n-5)\7-(n>4) \\ M. F. Hasler, Nov 02 2013
(Magma) [0..3] cat [n : n in [3..100] | n mod 8 in [0, 1, 2, 4, 5, 6, 7]]; // Wesley Ivan Hurt, Jul 22 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved