OFFSET
0,2
COMMENTS
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
A046901(a(n)) = 1. - Reinhard Zumkeller, Jan 31 2013
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
Also the number of maximal cliques in the (n+1)-Hanoi graph. - Eric W. Weisstein, Dec 01 2017
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
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..500
Eric Weisstein's World of Mathematics, Hanoi Graph
Eric Weisstein's World of Mathematics, Maximal Clique
Index entries for linear recurrences with constant coefficients, signature (4,-3).
FORMULA
a(n) = 3*(a(n-1) + 1), with a(0)=1.
From R. J. Mathar, Jan 31 2008: (Start)
O.g.f.: (5/2)/(1-3*x) - (3/2)/(1-x).
a(n) = (A005030(n) - 3)/2. (End)
a(n) = A060816(n+1) - 1. - Philippe Deléham, Apr 14 2013
E.g.f.: exp(x)*(5*exp(2*x) - 3)/2. - Stefano Spezia, Aug 28 2023
MAPLE
seq((5*3^n-3)/2, n= 0..25); # Gary Detlefs, Jun 22 2010
MATHEMATICA
a=1; lst={a}; Do[a=a*3+3; AppendTo[lst, a], {n, 0, 100}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 25 2008 *)
Table[(5 3^n - 9)/6, {n, 20}] (* Eric W. Weisstein, Dec 01 2017 *)
(5 3^Range[20] - 9)/6 (* Eric W. Weisstein, Dec 01 2017 *)
LinearRecurrence[{4, -3}, {1, 6}, 20] (* Eric W. Weisstein, Dec 01 2017 *)
CoefficientList[Series[(1 + 2 x)/(1 - 4 x + 3 x^2), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
PROG
(Magma) [(5*3^n-3)/2: n in [0..30]]; // Vincenzo Librandi, Jun 05 2011
(PARI) a(n) = (5*3^n-3)/2; /* Joerg Arndt, Apr 14 2013 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Rolf Pleisch, Jan 29 2008
EXTENSIONS
More terms from Vladimir Joseph Stephan Orlovsky, Dec 25 2008
STATUS
approved