A121262 The characteristic function of the multiples of four.
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0
Offset: 0
References
- G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 82.
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
- Vladimir Baltic, On the number of certain types of strongly restricted permutations, Applicable Analysis and Discrete Mathematics 4 (2010), 119-135
- Steve Chow, 0,0,0,1,0,0,0,1 (deriving an explicit formula for the sequence) :YouTube Video, 2017.
- Index entries for characteristic functions
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Crossrefs
Programs
-
Haskell
a121262 = (0 ^) . flip mod 4 -- Reinhard Zumkeller, Mar 04 2015 a121262_list = cycle [1,0,0,0] -- Reinhard Zumkeller, Jan 06 2012
-
Magma
&cat [[1, 0, 0, 0]^^30]; // Wesley Ivan Hurt, Jul 07 2016
-
Maple
seq(op([1, 0, 0, 0]), n=0..50); # Wesley Ivan Hurt, Jul 07 2016
-
Mathematica
Table[Boole[IntegerQ[n/4]], {n,0,127}] (* Alonso del Arte, Jul 14 2013 *)
-
PARI
a(n)=!(n%4) \\ Charles R Greathouse IV, Oct 25 2012
Formula
a(n) = (1/4)*(2*cos(n*Pi/2) + 1 + (-1)^n).
Additive with a(p^e) = 1 if p = 2 and e > 1, 0 otherwise.
Sequence shifted right by 2 is additive with a(p^e) = 1 if p = 2 and e = 1, 0 otherwise.
a(n) = 1 - (C(n + 1, n + (-1)^(n+1)) mod 2).
a(n) = 0^(n mod 4). - Reinhard Zumkeller, Sep 30 2008
a(n) = !(n%4). - Jaume Oliver Lafont, Mar 01 2009
a(n) = (1/4)*(1 + I^n + (-1)^n + (-I)^n). - Paolo P. Lava, May 04 2010
a(n) = ((n-1)^k mod 4 - (n-1)^(k-1) mod 4)/2, k > 2. - Gary Detlefs, Feb 21 2011
a(n) = floor(1/2*cos(n*Pi/2) + 1/2). - Gary Detlefs, May 16 2011
G.f.: 1/(1 - x^4); a(n) = (1 + (-1)^n)*(1 + i^((n-1)*n))/4, where i = sqrt(-1). - Bruno Berselli, Sep 28 2011
a(n) = floor(((n+3) mod 4)/3). - Gary Detlefs, Dec 29 2011
a(n) = floor(n/4) - floor((n-1)/4). - Tani Akinari, Oct 25 2012
a(n) = ceiling( (1/2)*cos(Pi*n/2) ). - Wesley Ivan Hurt, May 31 2013
a(n) = ((1+(-1)^(n/2))*(1+(-1)^n))/4. - Bogart B. Strauss, Jul 14 2013
a(n) = C(n-1,3) mod 2. - Wesley Ivan Hurt, Oct 07 2014
a(n) = (((n+1) mod 4) mod 3) mod 2. - Ctibor O. Zizka, Dec 11 2014
a(n) = (sin(Pi*(n+1)/2)^2)/2 + sin(Pi*(n+1)/2)/2. - Mikael Aaltonen, Jan 02 2015
E.g.f.: (cos(x) + cosh(x))/2. - Vaclav Kotesovec, Feb 15 2015
a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 07 2016
a(n) = (1-sqrt(2)*cos(n*Pi/2-3*Pi/4))/2 * cos(n*Pi/2). - (found by Steve Chow) Iain Fox, Nov 16 2017
a(n) = 1-A166486(n). - Antti Karttunen, Jul 29 2018
a(n) = (1-(-1)^A142150(n+1))/2. - Adriano Caroli, Sep 28 2019
Extensions
More terms from Antti Karttunen, Jul 29 2018
Comments