cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A135370 a(1)=1; then if n even a(n) = n + a(n-1), if n odd a(n) = 2*n + a(n-1).

This page as a plain text file.
%I A135370 #42 Jan 16 2025 12:08:42
%S A135370 1,3,9,13,23,29,43,51,69,79,101,113,139,153,183,199,233,251,289,309,
%T A135370 351,373,419,443,493,519,573,601,659,689,751,783,849,883,953,989,1063,
%U A135370 1101,1179,1219,1301,1343,1429,1473,1563,1609,1703,1751,1849,1899,2001,2053
%N A135370 a(1)=1; then if n even a(n) = n + a(n-1), if n odd a(n) = 2*n + a(n-1).
%C A135370 Nonnegative numbers k such that 12*k + 13 is a square. - _Bruno Berselli_, Feb 16 2018
%H A135370 Pierre CAMI, <a href="/A135370/b135370.txt">Table of n, a(n) for n = 1..1000</a>
%H A135370 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F A135370 a(n) ~ 0.75*n^2 (the sequence a(n)/n^2 has limit 3/4). - _Stefan Steinerberger_, Dec 10 2007
%F A135370 From _R. J. Mathar_, Oct 24 2008: (Start)
%F A135370 G.f.: x*(1 + 2*x + 4*x^2 - x^4)/((1 + x)^2*(1 - x)^3).
%F A135370 a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
%F A135370 a(n) = -7/8 + 3*n*(n+1)/4 - (-1)^n*(1 + 2*n)/8. (End)
%F A135370 a(n) = (lcm(f(n), f(n) + 3) - 1)/3, where f(n) = floor((3*n - 1)/2). - _Gary Detlefs_, May 14 2011
%F A135370 a(n) = 2*A001318(n) - 1. - _Peter Bala_, Jan 15 2025
%F A135370 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
%t A135370 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 *)
%t A135370 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 *)
%o A135370 (PARI) a(n)=lcm((3*n-1)\2,(3*n+5)\2)\3 \\ _Charles R Greathouse IV_, Dec 28 2011
%Y A135370 Cf. A001318, A001651.
%K A135370 nonn,easy
%O A135370 1,2
%A A135370 _Pierre CAMI_, Dec 09 2007
%E A135370 More terms from _Stefan Steinerberger_, Dec 10 2007