|
|
A166486
|
|
Periodic sequence [0,1,1,1] of length 4; Characteristic function of numbers that are not multiples of 4.
|
|
42
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
FORMULA
|
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)).
a(n) = (3 - i^n - (-i)^n - (-1)^n) / 4, where i=sqrt(-1).
Sum_{k>0} a(k)/(k*3^k) = log(5)/4.
Multiplicative with a(p^e) = (if p=2 then 0^(e-1) else 1), p prime and e>0.
A033436(n) = Sum{k=0..n} a(k)*(n-k).
(End)
a(n) = (Fibonacci(n)*Fibonacci(3n) mod 3)/2. - Gary Detlefs Dec 21 2010
Euler transform of length 4 sequence [ 1, 0, -1, 1]. - Michael Somos, Feb 12 2011
Dirichlet g.f. (1-1/4^s)*zeta(s). - R. J. Mathar, Feb 19 2011
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
a(n) = [A010873(n) > 0], where [ ] is the Iverson bracket.
(End)
|
|
EXAMPLE
|
G.f. = x + x^2 + x^3 + x^5 + x^6 + x^7 + x^9 + x^10 + x^11 + x^13 + x^14 + ...
|
|
MAPLE
|
seq(1/2*((n^3+n) mod 4), n=0..50); # Gary Detlefs, Mar 20 2010
|
|
MATHEMATICA
|
Table[Ceiling[n/4] - Floor[n/4], {n, 0, 100}] (* Wesley Ivan Hurt, Jun 20 2014 *)
|
|
PROG
|
(PARI) {a(n) = !!(n%4)};
(Magma) [Ceiling(n/4)-Floor(n/4) : n in [0..50]]; // Wesley Ivan Hurt, Jun 20 2014
(Python)
|
|
CROSSREFS
|
Characteristic function of A042968, whose complement A008586 gives the positions of zeros (after its initial term).
Sequence A152822 shifted by two terms.
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).
|
|
KEYWORD
|
nonn,mult,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|