A135370 a(1)=1; then if n even a(n) = n + a(n-1), if n odd a(n) = 2*n + a(n-1).
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, 1899, 2001, 2053
Offset: 1
Links
- Pierre CAMI, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
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 *)
-
PARI
a(n)=lcm((3*n-1)\2,(3*n+5)\2)\3 \\ Charles R Greathouse IV, Dec 28 2011
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
a(n) = 2*A001318(n) - 1. - Peter Bala, Jan 15 2025
E.g.f.: (4 + (3*x^2 + 7*x - 4)*cosh(x) + (3*x^2 + 5*x - 3)*sinh(x))/4. - Stefano Spezia, Jan 16 2025
Extensions
More terms from Stefan Steinerberger, Dec 10 2007
Comments