|
|
A005590
|
|
a(0) = 0, a(1) = 1, a(2n) = a(n), a(2n+1) = a(n+1) - a(n).
(Formerly M0048)
|
|
34
|
|
|
0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -4, -3, 1, -2, 3, 1, -2, -1, 3, 2, -1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -5, -4, 1, -3, 4, 1, -3, -2, 5, 3, -2, 1, -3, -2, 1, -1, 4, 3, -1, 2, -3, -1, 2, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,10
|
|
COMMENTS
|
If "-" in the definition is changed to "+", we get Stern's diatomic sequence A002487.
Sequence is 2-regular.
Let M = a triangular matrix with (1, 1, -1, 0, 0, 0, ...) in every column >k=1 shifted down twice from the previous column. Then A005590 starting with 1 = lim_{n->infinity} M^n, the left-shifted vector considered as a sequence. - Gary W. Adamson, Apr 13 2010
|
|
REFERENCES
|
B. Reznick, A new sequence with many properties, Abstract 809-10-185, Abstracts Amer. Math. Soc., 5 (1984), p. 16. [See link below]
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
Bruce Reznick, Letter to N. J. A. Sloane, Jun 03 1991; also annotated scanned copy of B. Reznick, A new sequence with many properties, Abstract 809-10-185, Abstracts Amer. Math. Soc., 5 (1984), p. 16.
|
|
FORMULA
|
G.f.: x*Product_{k>=0} (1+x^(2^k) - x^2^(k+1)). - Ralf Stephan, Apr 26 2003
a(n) = Sum_{k=0..n-1} (-1)^A010060(n-k-1)*(binomial(k, n-k-1) mod 2). - Paul Barry, Mar 26 2005
G.f. satisfies A(x) = (1 + 1/x - x) * A(x^2). - Michael Somos, Sep 17 2003
limsup log(|a(n)|)/(log n) = 0.4309... [Reznick] - N. J. A. Sloane, Jul 23 2016
a(2^k*n+1) = a(n+1) - k*a(n);
a(2^k*n+3) = a(n) for k >= 2;
a(2^k*n+5) = -a(2^(k-1)*n+1) for k >= 3;
a(2^k*n+7) = a(2^(k-2)*n+1) for k >= 4;
a(2^k*n+2^k-1) = a(n) if k is even;
a(2^k*n+2^k-1) = a(n+1)-a(n)= a(2*n+1) if k is odd.
This implies that
a(2^k+1) = 1-k;
a(2^k+3) = 1 for k >= 2;
a(2^k+5) = k-2 for k >= 3;
a(2^k+7) = 3-k for k >= 4;
a(2^k-1) = 0 if k is even;
a(2^k-1) = 1 if k is odd.
(End)
|
|
EXAMPLE
|
G.f. = x + x^2 + x^4 - x^5 + x^7 + x^8 - 2*x^9 - x^10 + x^12 + x^13 + x^14 + ...
|
|
MAPLE
|
|
|
MATHEMATICA
|
a[0] = 0; a[1] = 1; a[n_] := a[n] = If[OddQ[n], a[(n-1)/2 + 1] - a[(n-1)/2], a[n/2]]; Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Nov 27 2012 *)
|
|
PROG
|
(PARI) {a(n) = if( n<=1, n>0, if(n%2, a(n\2+1) - a(n\2), a(n/2)))}; /* Michael Somos, Sep 17 2003 */
(Haskell)
import Data.List (transpose)
a005590 n = a005590_list !! n
a005590_list = 0 : 1 : concat (tail $ transpose
[a005590_list, zipWith (-) (tail a005590_list) a005590_list])
(Python)
l=[0, 1]
for n in range(2, 101):
l.append(l[n//2] if n%2==0 else l[(n + 1)//2] - l[(n - 1)//2])
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Mar 28 2003
|
|
STATUS
|
approved
|
|
|
|