login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A121262
The characteristic function of the multiples of four.
54
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,1
COMMENTS
Period 4: repeat [1, 0, 0, 0].
a(n) is also the number of partitions of n where each part is four (Since the empty partition has no parts, a(0) = 1). Hence a(n) is also the number of 2-regular graphs on n vertices such that each component has girth exactly four. - Jason Kimberley, Oct 01 2011
This sequence is the Euler transformation of A185014. - Jason Kimberley, Oct 01 2011
Number of permutations satisfying -k <= p(i) - i <= r and p(i)-i not in I, i = 1..n, with k = 1, r = 3, I = {0, 1, 2}. - Vladimir Baltic, Mar 07 2012
REFERENCES
G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 82.
LINKS
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.
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
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 *)
PROG
(Haskell)
a121262 = (0 ^) . flip mod 4 -- Reinhard Zumkeller, Mar 04 2015
a121262_list = cycle [1, 0, 0, 0] -- Reinhard Zumkeller, Jan 06 2012
(PARI) a(n)=!(n%4) \\ Charles R Greathouse IV, Oct 25 2012
(Magma) &cat [[1, 0, 0, 0]^^30]; // Wesley Ivan Hurt, Jul 07 2016
CROSSREFS
A011765 is another version of the same sequence.
Characteristic function of multiples of g: A000007 (g=0), A000012 (g=1), A059841 (g=2), A079978 (g=3), this sequence (g=4), A079998 (g=5), A079979 (g=6), A082784 (g=7). - Jason Kimberley, Oct 14 2011
Sequence in context: A015985 A015777 A014017 * A181923 A339825 A290098
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Aug 23 2006, Aug 30 2007
EXTENSIONS
More terms from Antti Karttunen, Jul 29 2018
STATUS
approved