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
1, 3, 12, 16, 41, 47, 96, 104, 185, 195, 316, 328, 497, 511, 736, 752, 1041, 1059, 1420, 1440, 1881, 1903, 2432, 2456, 3081, 3107, 3836, 3864, 4705, 4735, 5696, 5728, 6817, 6851, 8076, 8112, 9481, 9519, 11040, 11080, 12761, 12803, 14652, 14696, 16721 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The only prime terms are 3, 41, 47.
The semiprime terms are A136048.
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).
LINKS
FORMULA
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)).
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]
MATHEMATICA
a[1]=1; a[n_]:=a[n]=a[n-1]+n^(1+Mod[n, 2]); Table[a[n], {n, 100}]
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 *)
CROSSREFS
Sequence in context: A022411 A115229 A224924 * A082965 A045549 A103249
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Dec 12 2007
EXTENSIONS
Edited by Michel Marcus, Mar 02 2022
STATUS
approved

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 March 19 01:57 EDT 2024. Contains 370952 sequences. (Running on oeis4.)