%I #53 Aug 28 2023 14:29:18
%S 1,6,21,66,201,606,1821,5466,16401,49206,147621,442866,1328601,
%T 3985806,11957421,35872266,107616801,322850406,968551221,2905653666,
%U 8716961001,26150883006,78452649021,235357947066,706073841201,2118221523606
%N a(n) = (5*3^n-3)/2.
%C Numbers n where the recurrence s(0)=1, if s(n-1) >= n then s(n) = s(n-1) - n else s(n) = s(n-1) + n produces s(n)=0. - _Hugo Pfoertner_, Jan 05 2012
%C A046901(a(n)) = 1. - _Reinhard Zumkeller_, Jan 31 2013
%C Binomial transform of A146523: (1, 5, 10, 20, 40, ...) and double binomial transform of A010685: (1, 4, 1, 4, 1, 4, ...). - _Gary W. Adamson_, Aug 25 2016
%C Also the number of maximal cliques in the (n+1)-Hanoi graph. - _Eric W. Weisstein_, Dec 01 2017
%C a(n) is the least k such that f(a(n-1)+1) + ... + f(k) > f(a(n-2)+1) + ... + f(a(n-1)) for n > 1, where f(n) = 1/(n+1). Because Sum_{k=1..5*3^(n-1)} 1/(a(n)+3*k-1) + 1/(a(n)+3*k) + 1/(a(n)+3*k+1) - 1/((a(n)+1+5*3^n)*5*3^(n-1)) < Sum_{k=1..5*3^(n-1)} 1/(a(n-1)+k+1) < Sum_{k=1..5*3^(n-1)} 1/(a(n)+3*k-1) + 1/(a(n)+3*k) + 1/(a(n)+3*k+1), we have 1 < 1/3 + 1/4 + ... + 1/7 < 1/8 + 1/9 + ... + 1/22 < ... . - _Jinyuan Wang_, Jun 15 2020
%H Vincenzo Librandi, <a href="/A134931/b134931.txt">Table of n, a(n) for n = 0..500</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HanoiGraph.html">Hanoi Graph</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/MaximalClique.html">Maximal Clique</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (4,-3).
%F a(n) = 3*(a(n-1) + 1), with a(0)=1.
%F From _R. J. Mathar_, Jan 31 2008: (Start)
%F O.g.f.: (5/2)/(1-3*x) - (3/2)/(1-x).
%F a(n) = (A005030(n) - 3)/2. (End)
%F a(n) = A060816(n+1) - 1. - _Philippe Deléham_, Apr 14 2013
%F E.g.f.: exp(x)*(5*exp(2*x) - 3)/2. - _Stefano Spezia_, Aug 28 2023
%p seq((5*3^n-3)/2, n= 0..25); # _Gary Detlefs_, Jun 22 2010
%t a=1; lst={a}; Do[a=a*3+3; AppendTo[lst,a], {n,0,100}]; lst (* _Vladimir Joseph Stephan Orlovsky_, Dec 25 2008 *)
%t Table[(5 3^n - 9)/6, {n, 20}] (* _Eric W. Weisstein_, Dec 01 2017 *)
%t (5 3^Range[20] - 9)/6 (* _Eric W. Weisstein_, Dec 01 2017 *)
%t LinearRecurrence[{4, -3}, {1, 6}, 20] (* _Eric W. Weisstein_, Dec 01 2017 *)
%t CoefficientList[Series[(1 + 2 x)/(1 - 4 x + 3 x^2), {x, 0, 20}], x] (* _Eric W. Weisstein_, Dec 01 2017 *)
%o (Magma) [(5*3^n-3)/2: n in [0..30]]; // _Vincenzo Librandi_, Jun 05 2011
%o (PARI) a(n) = (5*3^n-3)/2; /* _Joerg Arndt_, Apr 14 2013 */
%Y Cf. A003462, A007051, A034472, A024023, A067771, A029858.
%Y Cf. A005030, A010685, A046901, A060816, A116952, A146523, A225918.
%K nonn,easy
%O 0,2
%A _Rolf Pleisch_, Jan 29 2008
%E More terms from _Vladimir Joseph Stephan Orlovsky_, Dec 25 2008