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!)
A136047 a(1)=1, a(n)=a(n-1)+n if n even, a(n)=a(n-1)+ n^2 if n is odd. 31

%I #22 Mar 02 2022 09:23:10

%S 1,3,12,16,41,47,96,104,185,195,316,328,497,511,736,752,1041,1059,

%T 1420,1440,1881,1903,2432,2456,3081,3107,3836,3864,4705,4735,5696,

%U 5728,6817,6851,8076,8112,9481,9519,11040,11080,12761,12803,14652,14696,16721

%N a(1)=1, a(n)=a(n-1)+n if n even, a(n)=a(n-1)+ n^2 if n is odd.

%C The only prime terms are 3, 41, 47.

%C The semiprime terms are A136048.

%C Cf. A001082/A135370: f(1) = 1, then if n even/odd f(n) = n+f(n-1), if n odd/even f(n) = 2*n+f(n-1).

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

%F a(n) = (1/12)(1 + n)(2n^2+7n-3) if n is odd, a(n)=(1/12)n(2n^2+3n+4) if n is even.

%F a(n) = (-3 + 3*(-1)^n + 8*n + 12*n^2 - 6*(-1)^n*n^2 + 4*n^3)/24.

%F a(1)=1 then a(n) = a(n-1)+n^(if n is even then 1 else 2),

%F or a(n) = a(n-1)+n^(1+mod(n,2)),

%F or a(n) = a(n-1)+n^((3-(-1)^n)/2)).

%F a(n) = a(n-1)+3a(n-2)-3a(n-3)-3a(n-4)+3a(n-5)+a(n-6)-a(n-7). G.f.: x*(1+2*x+6*x^2-2*x^3+x^4)/((1+x)^3*(x-1)^4). [_R. J. Mathar_, Feb 22 2009]

%t a[1]=1;a[n_]:=a[n]=a[n-1]+n^(1+Mod[n,2]); Table[a[n],{n,100}]

%t nxt[{n_,a_}]:={n+1,If[OddQ[n],a+n+1,a+(n+1)^2]}; Transpose[NestList[nxt,{1,1},50]][[2]] (* _Harvey P. Dale_, Oct 11 2015 *)

%Y Cf. A001082, A135370, A136048.

%K nonn,easy

%O 1,2

%A _Zak Seidov_, Dec 12 2007

%E Edited by _Michel Marcus_, Mar 02 2022

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 24 12:31 EDT 2024. Contains 371937 sequences. (Running on oeis4.)