cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A232991 Period 6: repeat [1, 0, 0, 0, 1, 0].

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

N. J. A. Sloane, Dec 13 2013

Keywords

References

  • 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.

Crossrefs

Programs

  • Haskell
    a232991 = (0 ^) . subtract 1 . gcd 6 . (+ 1)
    a232991_list = cycle [1,0,0,0,1,0]
    -- Reinhard Zumkeller, Apr 06 2015
    
  • Magma
    /* By definition: */ &cat [[1,0,0,0,1,0]: n in [0..20]]; // Bruno Berselli, Feb 18 2015
    
  • Magma
    [(((n+3) mod 6) mod 5) mod 2: n in [0..100]]; // Vincenzo Librandi, Feb 18 2015
    
  • Maple
    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
  • Mathematica
    Table[Ceiling[(n + 4)/6] - Floor[(n + 4)/6] - Mod[n, 2], {n, 0, 100}] (* Wesley Ivan Hurt, Mar 13 2014 *)
    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 *)
  • PARI
    a(n)=(n+9)\6 - (n+4)\6 - n%2 \\ Charles R Greathouse IV, Jul 17 2016
    
  • Python
    def A232991(n): return int(not (n+1) % 6 & 3 ^ 1) # Chai Wah Wu, May 25 2022

Formula

a(n) = ceiling((n + 4)/6) - floor((n + 4)/6) - (n mod 2). - Wesley Ivan Hurt, Mar 13 2014
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
G.f.: (1 + x^4)/(1 - x^6). - Bruno Berselli, Feb 18 2015
a(n) = if gcd(n+1, 6) > 1 then 0, otherwise 1. - Reinhard Zumkeller, Apr 06 2015
a(n) = a(n-6) for n > 5. - Wesley Ivan Hurt, Jun 20 2016
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
a(n) = gcd(gcd(floor((n+2)/3), 2), n) - 1. - Lechoslaw Ratajczak, Jul 30 2021
a(n) = sign((n+1) mod ((5+(-1)^n)/2)). - Wesley Ivan Hurt, Feb 04 2022