|
|
A152822
|
|
Periodic sequence [1,1,0,1] of length 4.
|
|
16
|
|
|
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, 1, 1, 1, 0, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 3/4 - (1/4)*(-1)^n + (1/2)*cos(n*Pi/2);
a(n+4) = a(n) with a(0) = a(1) = a(3) = 1 and a(2) = 0;
O.g.f.: (1+z+z^3)/(1-z^4);
a(n) = (1/8)*((n mod 4) - ((n+1) mod 4) + 3*((n+2) mod 4)((n+3) mod 4)), with n >= 0.
a(n) = (1/4)*(3 + i^n + (-i)^n - (-1)^n), with n >= 0 and i = sqrt(-1). (End)
Multiplicative with a(p^e) = 1 for odd primes, and a(2^e) = [e > 1]. (Here [ ] is the Iverson bracket, i.e., a(2^e) = 0 if e=1, and 1 if e>1).
(End)
Dirichlet g.f.: zeta(s)*(1 - 1/2^s + 1/4^s). - Amiram Eldar, Dec 27 2022
|
|
MAPLE
|
a:= n-> [1, 1, 0, 1][1+irem(n, 4)]:
|
|
PROG
|
(PARI) A152822(n) = { my(f=factor(n)); prod(k=1, #f~, if(2==f[k, 1], f[k, 2]>1, 1)); }; \\ (After multiplicative formula) - Antti Karttunen, May 03 2022
(Python)
|
|
CROSSREFS
|
Characteristic function of A042965.
Sequence A166486 shifted by two terms.
|
|
KEYWORD
|
easy,nonn,mult
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|