login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A047573 Numbers that are congruent to {0, 1, 2, 4, 5, 6, 7} mod 8. 1

%I #33 Jan 27 2023 10:07:29

%S 0,1,2,4,5,6,7,8,9,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,28,29,

%T 30,31,32,33,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,52,53,54,55,

%U 56,57,58,60,61,62,63,64,65,66,68,69,70,71,72,73,74,76,77,78,79,80,81

%N Numbers that are congruent to {0, 1, 2, 4, 5, 6, 7} mod 8.

%C Complement of A017101. - _Michel Marcus_, Sep 13 2015

%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,1,-1).

%F 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]

%F From _Wesley Ivan Hurt_, Sep 12 2015: (Start)

%F a(n) = a(n-1) + a(n-7) - a(n-8) for n>8.

%F a(n) = n + floor((n-4)/7). (End)

%F From _Wesley Ivan Hurt_, Jul 21 2016: (Start)

%F a(n) = a(n-7) + 8 for n>7.

%F 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.

%F 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)

%p for n from 0 to 200 do if n mod 8 <> 3 then printf(`%d,`,n) fi: od:

%t Table[n+Floor[(n-4)/7], {n, 100}] (* _Wesley Ivan Hurt_, Sep 12 2015 *)

%t LinearRecurrence[{1, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 2, 4, 5, 6, 7, 8}, 80] (* _Vincenzo Librandi_, Sep 13 2015 *)

%t DeleteCases[Range[0,100],_?(Mod[#,8]==3&)] (* _Harvey P. Dale_, Oct 05 2020 *)

%o (Magma) [n+Floor((n-4)/7) : n in [1..100]]; // _Wesley Ivan Hurt_, Sep 12 2015

%o (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

%o (Python)

%o def A047573(n):

%o a, b = divmod(n-1,7)

%o return (0,1,2,4,5,6,7)[b]+(a<<3) # _Chai Wah Wu_, Jan 27 2023

%Y Cf. A017101 (8n+3).

%K nonn,easy

%O 1,3

%A _N. J. A. Sloane_

%E More terms from _James A. Sellers_, Feb 19 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 2 16:12 EDT 2024. Contains 372197 sequences. (Running on oeis4.)