|
|
A000034
|
|
Period 2: repeat [1, 2]; a(n) = 1 + (n mod 2).
(Formerly M0089)
|
|
136
|
|
|
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
The sequence 1,-2,-1,2,1,-2,-1,2,... with g.f. (1-2x)/(1+x^2) has a(n) = cos(Pi*n/2)-2*sin(Pi*n/2). -Paul Barry,Oct 18 2004
Hankel transform is [1,-3,0,0,0,0,0,0,0,...]. -Philippe Deléham,Mar 29 2007
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=A[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1) = charpoly(A,2). -Milan Janjic,Jan 24 2010
Denominator of the harmonic mean of the first n triangular numbers. -Colin Barker,Nov 13 2014
This is the lexicographically earliest sequence of positive integers such that no polynomial of degree d can be fitted to d+2 consecutive terms (equivalently, such that no iterated difference is zero). -Pontus von Brömssen,Dec 26 2021 [SeeA300002for the case where not only consecutive terms are considered. -Pontus von Brömssen,Jan 03 2023]
Number of maximum antichains in the power set of {1,2,...,n} partially ordered by set inclusion. For even n, there is a unique maximum antichain formed by all subsets of size n/2; for odd n, there are two maximum antichains, one formed by all subsets of size (n-1)/2 and the other formed by all subsets of size (n+1)/2. See the David Guichard link below for a proof. -Jianing Song,Jun 19 2022
|
|
REFERENCES
|
Jozsef Beck, Combinatorial Games, Cambridge University Press, 2008.
J.-M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 545 pages 73 and 260, Ellipses, Paris 2004.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
Glen Joyce C. Dulatre, Jamilah V. Alarcon, Vhenedict M. Florida and Daisy Ann A. Disu,On Fractal Sequences,DMMMSU-CAS Science Monitor (2016-2017) Vol. 15 No. 2, 109-113.
|
|
FORMULA
|
G.f.: (1+2*x)/(1-x^2).
a(n) = 2^((1-(-1)^n)/2) = 2^(ceiling(n/2) - floor(n/2)). -Paul Barry,Jun 03 2003
a(n) = (3-(-1)^n)/2; a(n) = 1 + (n mod 2) = 3-a(n-1) = a(n-2) = a(-n).
a(n) = if(n=0,1,if(mod(a(n-1),2)=0,a(n-1)/2,(3*a(n-1)+1)/2)). See Collatz conjecture. -Paul Barry,Mar 31 2008
Dirichlet g.f.: zeta(s)*(1 + 1/2^s). -Mats Granvik,Jul 18 2016
Limit_{n->oo} (1/n)*Sum_{k=1..n} a(k) = 3/2 (De Koninck reference). -Bernard Schott,Nov 09 2021
|
|
MAPLE
|
(1+2*x)/(1-x^2);
|
|
MATHEMATICA
|
Nest[ Flatten[# /. { 0 -> {1}, 1 -> {2}, 2 -> {1, 2, 1} }] &, {1}, 8] (*Robert G. Wilson v,May 20 2014 *)
|
|
PROG
|
(PARI) a(n)=1+n%2
(Haskell)
a000034 = (+ 1). (`mod` 2)
a000034_list = cycle [1, 2]
(Python)
|
|
CROSSREFS
|
Cf.A000035,A003945(binomial transf),A007089,A010693,A010704,A010888,A032766,A040001,A123344,A134451,A300002.
Cf. sequences listed in Comments section ofA283393.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|