login
A135370
a(1)=1; then if n even a(n) = n + a(n-1), if n odd a(n) = 2*n + a(n-1).
5
1, 3, 9, 13, 23, 29, 43, 51, 69, 79, 101, 113, 139, 153, 183, 199, 233, 251, 289, 309, 351, 373, 419, 443, 493, 519, 573, 601, 659, 689, 751, 783, 849, 883, 953, 989, 1063, 1101, 1179, 1219, 1301, 1343, 1429, 1473, 1563, 1609, 1703, 1751, 1849
OFFSET
1,2
COMMENTS
Nonnegative numbers k such that 12*k + 13 is a square. - Bruno Berselli, Feb 16 2018
FORMULA
a(n) ~ 0.75*n^2 (the sequence a(n)/n^2 has limit 3/4). - Stefan Steinerberger, Dec 10 2007
From R. J. Mathar, Oct 24 2008: (Start)
G.f.: x*(1 + 2*x + 4*x^2 - x^4)/((1 + x)^2*(1 - x)^3).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = -7/8 + 3*n*(n+1)/4 - (-1)^n*(1 + 2*n)/8. (End)
a(n) = (lcm(f(n), f(n) + 3) - 1)/3, where f(n) = floor((3*n - 1)/2). - Gary Detlefs, May 14 2011
MATHEMATICA
a = {1}; For[n = 2, n < 100, n++, If[OddQ[n], AppendTo[a, 2*n + a[[ -1]]], AppendTo[a, n + a[[ -1]]]]]; a (* Stefan Steinerberger, Dec 10 2007 *)
nxt[{n_, a_}]:={n+1, If[OddQ[n], a+n+1, a+2n+2]}; NestList[nxt, {1, 1}, 50][[All, 2]] (* Harvey P. Dale, May 17 2021 *)
PROG
(PARI) a(n)=lcm((3*n-1)\2, (3*n+5)\2)\3 \\ Charles R Greathouse IV, Dec 28 2011
CROSSREFS
Cf. A001651.
Sequence in context: A118570 A212244 A004617 * A206802 A285900 A022408
KEYWORD
nonn,easy
AUTHOR
Pierre CAMI, Dec 09 2007
EXTENSIONS
More terms from Stefan Steinerberger, Dec 10 2007
STATUS
approved