login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A121262 The characteristic function of the multiples of four. 29
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

Period 4: repeat [1, 0, 0, 0].

This sequence can be used to produce a periodic sequence of 4 numbers b, c, d, e: a(n) = b*(1/4)*(2*cos(n*Pi/2) + 1 + (-1)^n) + c*(1/4)*(2*cos((n+3)*Pi/2) + 1 + (-1)^(n+3)) + d*(1/4)*(2*cos((n+2)*Pi/2) + 1 + (-1)^(n+2)) + e*(1/4)*(2*cos((n+1)*Pi/2) + 1 + (-1)^(n+1)).

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

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

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) = (1/24)*(-5*(n mod 4) + ((n+1) mod 4) + ((n+2) mod 4) + 7*((n+3) mod 4)). - Paolo P. Lava, Feb 06 2009

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

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

Cf. A010873, A166486, A185014.

Sequence in context: A015985 A015777 A014017 * A173859 A202108 A104108

Adjacent sequences:  A121259 A121260 A121261 * A121263 A121264 A121265

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

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 21:09 EDT 2018. Contains 316505 sequences. (Running on oeis4.)