login
Period 6: repeat [1, 0, 0, 0, 1, 0].
5

%I #54 Dec 12 2023 07:45:43

%S 1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,

%T 1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,

%U 0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1

%N Period 6: repeat [1, 0, 0, 0, 1, 0].

%D Andrews, George E., q-series: their development and application in analysis, number theory, combinatorics, physics, and computer algebra. CBMS Regional Conference Series in Mathematics, 66. Published for the Conference Board of the Mathematical Sciences, Washington, DC; by the American Mathematical Society, Providence, RI, 1986. xii+130 pp. ISBN: 0-8218-0716-1 MR0858826 (88b:11063). See p. 105.

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

%F a(n) = ceiling((n + 4)/6) - floor((n + 4)/6) - (n mod 2). - _Wesley Ivan Hurt_, Mar 13 2014

%F a(n) = cos(Pi*n/2)/3*(cos(Pi*n/6) + 2*cos(Pi*n/2) + sqrt(3)*sin(Pi*n/6)). - _Vaclav Kotesovec_, Mar 23 2014

%F G.f.: (1 + x^4)/(1 - x^6). - _Bruno Berselli_, Feb 18 2015

%F a(n) = if gcd(n+1, 6) > 1 then 0, otherwise 1. - _Reinhard Zumkeller_, Apr 06 2015

%F a(n) = a(n-6) for n > 5. - _Wesley Ivan Hurt_, Jun 20 2016

%F E.g.f.: (2*cosh(x) - sqrt(3)*sin(sqrt(3)*x/2)*sinh(x/2) + cos(sqrt(3)*x/2)*cosh(x/2))/3. - _Ilya Gutkovskiy_, Jun 21 2016

%F a(n) = gcd(gcd(floor((n+2)/3), 2), n) - 1. - _Lechoslaw Ratajczak_, Jul 30 2021

%F a(n) = sign((n+1) mod ((5+(-1)^n)/2)). - _Wesley Ivan Hurt_, Feb 04 2022

%p A232991:=n->ceil((n+4)/6) - floor((n+4)/6) - (n mod 2): seq(A232991(n), n=0..100); # _Wesley Ivan Hurt_, Mar 13 2014

%t Table[Ceiling[(n + 4)/6] - Floor[(n + 4)/6] - Mod[n, 2], {n, 0, 100}] (* _Wesley Ivan Hurt_, Mar 13 2014 *)

%t Table[Cos[Pi*n/2]/3 * (Cos[Pi*n/6] + 2*Cos[Pi*n/2] + Sqrt[3]*Sin[Pi*n/6]), {n, 0, 100}] (* _Vaclav Kotesovec_, Mar 23 2014 *)

%o (Magma) /* By definition: */ &cat [[1,0,0,0,1,0]: n in [0..20]]; // _Bruno Berselli_, Feb 18 2015

%o (Magma) [(((n+3) mod 6) mod 5) mod 2: n in [0..100]]; // _Vincenzo Librandi_, Feb 18 2015

%o (Haskell)

%o a232991 = (0 ^) . subtract 1 . gcd 6 . (+ 1)

%o a232991_list = cycle [1,0,0,0,1,0]

%o -- _Reinhard Zumkeller_, Apr 06 2015

%o (PARI) a(n)=(n+9)\6 - (n+4)\6 - n%2 \\ _Charles R Greathouse IV_, Jul 17 2016

%o (Python)

%o def A232991(n): return int(not (n+1) % 6 & 3 ^ 1) # _Chai Wah Wu_, May 25 2022

%Y Cf. A089128, A232990.

%K nonn,easy

%O 0,1

%A _N. J. A. Sloane_, Dec 13 2013