The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 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

%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. The semiprime terms are A136048: 185 = 5*37, 497 = 7*71, 511 = 7*73, 1041 = 3*347, 1059 = 3*353, 1903 = 11*173, 3107 = 13*239, 4705 = 5*941, 4735 = 5*947, 6817 = 17*401, 9481 = 19*499, 12761 = 7*1823, 16721 = 23*727, 33379 = 29*1151, 48961 = 11*4451, 49027 = 11*4457, 68857 = 37*1861, 80561 = 13*6197, 80639 = 13*6203, 93521 = 41*2281. Cf. A001082/A135370: a(1) = 1, then if n even/odd a(n) = n+a(n-1), if n odd/even a(n) = 2*n+a(n-1).

%H <a href="/index/Rec">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; a(n)=(-3 + 3*(-1)^n + 8*n + 12*n^2 - 6*(-1)^n*n^2 + 4*n^3)/24; a(1)=1 then a(n)=a(n-1)+n^(if n is even then 1 else 2), or a(n)=a(n-1)+n^(1+mod(n,2)), 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). [From _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

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

Last modified September 27 10:35 EDT 2020. Contains 337380 sequences. (Running on oeis4.)