login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A153284 a(n) = n + Sum_{j=1..n-1} (-1)^j * a(j) for n >= 2, a(1) = 1. 6

%I #23 Sep 08 2022 08:45:39

%S 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,

%T 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,

%U 3,1

%N a(n) = n + Sum_{j=1..n-1} (-1)^j * a(j) for n >= 2, a(1) = 1.

%C Row sums of triangle A153860. - _Gary W. Adamson_, Jan 03 2009

%C 1 followed by interleaving of A000012 and A010701. - _Klaus Brockhaus_, Jan 04 2009

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,1).

%F a(n)=1 if n is 1 or even; a(n)=3 if n is odd other than 1.

%F G.f.: x*(1 + x + 2*x^2)/((1+x)*(1-x)). - _Klaus Brockhaus_, Jan 04 2009 and Oct 15 2009

%e 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.

%o (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

%Y Equals A010684 with the addition of the leading term of 1

%Y The first sequence of a family that includes A153285 and A153286

%Y Cf. A153860.

%Y Cf. A000012 (all 1's sequence), A010701 (all 3's sequence). - _Klaus Brockhaus_, Jan 04 2009

%K easy,nonn

%O 1,3

%A _Walter Carlini_, Dec 23 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)