[go: up one dir, main page]

login
A004776
Numbers not congruent to 5 (mod 8).
3
0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 78
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
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
Cf. A004770 (complement), A045323 (primes).
Sequence in context: A101771 A035058 A350757 * A187945 A137409 A037041
KEYWORD
nonn,easy
EXTENSIONS
Edited by M. F. Hasler, Nov 02 2013
STATUS
approved