|
|
A059841
|
|
Period 2: Repeat [1,0]. a(n) = 1 - (n mod 2); Characteristic function of even numbers.
|
|
236
|
|
|
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
When viewed as a triangular array, the row sum values are 0 1 1 1 2 3 3 3 4 5 5 5 6 ... (A004525).
This is the r=0 member of the r-family of sequences S_r(n) defined in A092184 where more information can be found.
Elementary Cellular Automata rule 77 produces this sequence. See Wolfram, Weisstein and Index links below. - Robert Price, Jan 30 2016
|
|
LINKS
|
|
|
FORMULA
|
G.f.: 1/(1-x^2).
E.g.f.: cosh(x).
a(n) = (n+1) mod 2.
a(n) = 1/2 + (-1)^n/2. (End)
Additive with a(p^e) = 1 if p = 2, 0 otherwise.
E.g.f.: cosh(x) = 1 + x^2/(Q(0) - x^2); Q(k) = 8k + 2 + x^2/(1 + (2k + 1)*(2k + 2)/Q(k + 1)); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
E.g.f.: cosh(x) = 1/2*Q(0); Q(k) = 1 + 1/(1 - x^2/(x^2 + (2k + 1)*(2k + 2)/Q(k + 1))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
E.g.f.: cosh(x) = E(0)/(1-x) where E(k) = 1 - x/(1 - x/(x - (2*k+1)*(2*k+2)/E(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Apr 05 2013
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
|
|
EXAMPLE
|
Triangle begins:
1;
0, 1;
0, 1, 0;
1, 0, 1, 0;
1, 0, 1, 0, 1;
0, 1, 0, 1, 0, 1;
0, 1, 0, 1, 0, 1, 0;
1, 0, 1, 0, 1, 0, 1, 0;
1, 0, 1, 0, 1, 0, 1, 0, 1;
0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0;
...
|
|
MAPLE
|
|
|
MATHEMATICA
|
CoefficientList[Series[1/(1 - x^2), {x, 0, 104}], x] (* or *)
Table[QBinomial[n, 1, -1], {n, 1, 74}] (* John Keith, Jun 28 2021 *)
|
|
PROG
|
(PARI) a(n)=(n+1)%2; \\ or 1-n%2 as in NAME.
(Haskell)
a059841 n = (1 -) . (`mod` 2)
a059841_list = cycle [1, 0]
(Python)
|
|
CROSSREFS
|
One's complement of A000035 (essentially the same, but shifted once).
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|