login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A166486 Periodic sequence [0,1,1,1] of length 4; Characteristic function of numbers that are not multiples of 4. 42

%I #106 Dec 12 2023 07:44:26

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

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

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

%N Periodic sequence [0,1,1,1] of length 4; Characteristic function of numbers that are not multiples of 4.

%H Antti Karttunen, <a href="/A166486/b166486.txt">Table of n, a(n) for n = 0..65537</a>

%H Michael Somos, <a href="http://cis.csuohio.edu/~somos/rfmc.html">Rational Function Multiplicative Coefficients</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

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

%F G.f.: (x + x^2 + x^3) / (1 - x^4) = x * (1 + x + x^2) / ((1 - x) * (1 + x) * (1 + x^2)) = x * (1 - x^3) / ((1 - x) * (1 - x^4)).

%F a(n) = (3 - i^n - (-i)^n - (-1)^n) / 4, where i=sqrt(-1).

%F Sum_{k>0} a(k)/(k*3^k) = log(5)/4.

%F From _Reinhard Zumkeller_, Nov 30 2009: (Start)

%F Multiplicative with a(p^e) = (if p=2 then 0^(e-1) else 1), p prime and e>0.

%F a(n) = 1-A121262(n).

%F a(A042968(n))=1; a(A008586(n))=0.

%F A033436(n) = Sum{k=0..n} a(k)*(n-k).

%F (End)

%F a(n) = 1/2*((n^3+n) mod 4). - _Gary Detlefs_, Mar 20 2010

%F a(n) = (Fibonacci(n)*Fibonacci(3n) mod 3)/2. - _Gary Detlefs_ Dec 21 2010

%F Euler transform of length 4 sequence [ 1, 0, -1, 1]. - _Michael Somos_, Feb 12 2011

%F Dirichlet g.f. (1-1/4^s)*zeta(s). - _R. J. Mathar_, Feb 19 2011

%F a(n) = Fibonacci(n)^2 mod 3. - _Gary Detlefs_, May 16 2011

%F a(n) = -1/4*cos(Pi*n)-1/2*cos(1/2*Pi*n)+3/4. - _Leonid Bedratyuk_, May 13, 2012

%F For the general case: the characteristic function of numbers that are not multiples of m is a(n)=floor((n-1)/m)-floor(n/m)+1, m,n > 0. - _Boris Putievskiy_, May 08 2013

%F a(n) = ceiling(n/4) - floor(n/4). - _Wesley Ivan Hurt_, Jun 20 2014

%F a(n) = a(-n) for all n in Z. - _Michael Somos_, May 05 2015

%F For n >= 1, a(n) = A053866(A225546(n)) = A000035(A331733(n)). - _Antti Karttunen_, Jul 07 2020

%F a(n) = signum(n mod 4). - _Alois P. Heinz_, May 12 2021

%F From _Antti Karttunen_, Dec 28 2022: (Start)

%F a(n) = [A010873(n) > 0], where [ ] is the Iverson bracket.

%F a(n) = abs(A046978(n)) = abs(A075553(n)) = abs(A131729(n)) = abs(A358839(n)).

%F For all n >= 1, a(n) = abs(A112299(n)) = abs(A257196(n))

%F a(n) = A152822(2+n).

%F a(n) = A359370(n) + A359372(n).

%F (End)

%e G.f. = x + x^2 + x^3 + x^5 + x^6 + x^7 + x^9 + x^10 + x^11 + x^13 + x^14 + ...

%p seq(1/2*((n^3+n) mod 4), n=0..50); # _Gary Detlefs_, Mar 20 2010

%t PadRight[{},120,{0,1,1,1}] (* _Harvey P. Dale_, Jul 04 2013 *)

%t Table[Ceiling[n/4] - Floor[n/4], {n, 0, 100}] (* _Wesley Ivan Hurt_, Jun 20 2014 *)

%t a[ n_] := Sign[ Mod[n, 4]]; (* _Michael Somos_, May 05 2015 *)

%o (PARI) {a(n) = !!(n%4)};

%o (Magma) [Ceiling(n/4)-Floor(n/4) : n in [0..50]]; // _Wesley Ivan Hurt_, Jun 20 2014

%o (Python)

%o def A166486(n): return (0,1,1,1)[n&3] # _Chai Wah Wu_, Jan 03 2023

%Y Characteristic function of A042968, whose complement A008586 gives the positions of zeros (after its initial term).

%Y Absolute values of A046978, A075553, A131729, A358839, and for n >= 1, also of A112299 and of A257196.

%Y Sequence A152822 shifted by two terms.

%Y Parity of A327860, A331733, A342002, A351083 and A345000.

%Y Row 3 of A225145, Column 2 of A229940 (after the initial term).

%Y First differences of A057353. Sum of A359370 and A359372.

%Y Cf. A000035, A011655, A011558, A097325, A109720, A168181, A168182, A168184, A145568, A168185 (characteristic functions for numbers that are not multiples of k = 2, 3 and 5..12).

%Y Cf. A016628, A164985, A165132.

%Y Cf. A010873, A033436, A069733 (inverse Möbius transform), A121262 (one's complement), A190621 [= n*a(n)], A355689 (Dirichlet inverse).

%K nonn,mult,easy

%O 0,1

%A _Jaume Oliver Lafont_, Oct 15 2009

%E Secondary definition (from _Reinhard Zumkeller_'s Nov 30 2009 comment) added to the name by _Antti Karttunen_, Dec 20 2022

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)