|
|
A153284
|
|
a(n) = n + Sum_{j=1..n-1} (-1)^j * a(j) for n >= 2, a(1) = 1.
|
|
6
|
|
|
1, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
a(n)=1 if n is 1 or even; a(n)=3 if n is odd other than 1.
G.f.: x*(1 + x + 2*x^2)/((1+x)*(1-x)). - Klaus Brockhaus, Jan 04 2009 and Oct 15 2009
|
|
EXAMPLE
|
a(1)=1, a(2)=2-a(1)=2-1=1, a(3)=3+a(2)-a(1)=3+1-1=3, a(4)=4-a(3)+a(2)-a(1)=4-3+1-1=1, a(5)=5+1-3+1-1=3, a(6)=6-3+1-3+1-1=1, a(7)=7+1-3+1-3+1-1, etc.
|
|
PROG
|
(Magma) S:=[ 1 ]; for n in [2..105] do Append(~S, n + &+[ (-1)^j*S[j]: j in [1..n-1] ]); end for; S; // Klaus Brockhaus, Jan 04 2009
|
|
CROSSREFS
|
Equals A010684 with the addition of the leading term of 1
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|