%I #94 Jun 23 2024 21:27:19
%S 1,5,17,53,161,485,1457,4373,13121,39365,118097,354293,1062881,
%T 3188645,9565937,28697813,86093441,258280325,774840977,2324522933,
%U 6973568801,20920706405,62762119217,188286357653,564859072961,1694577218885,5083731656657,15251194969973
%N a(0)=1, a(n) = 3*a(n-1) + 2; a(n) = 2*3^n - 1.
%C The number of triangles (of all sizes, including holes) in Sierpiński's triangle after n inscriptions. - Lee Reeves, May 10 2004
%C The sequence is not only related to Sierpiński's triangle, but also to "Floret's cube" and the quaternion factor space Q X Q / {(1,1), (-1,-1)}. It can be written as a_n = ves((A+1)x)^n) as described at the Math Forum Discussions link. - _Creighton Dement_, Jul 28 2004
%C Relation to C(n) = Collatz function iteration using only odd steps: If we look for record subsequences where C(n) > n, this subsequence starts at 2^n - 1 and stops at the local maximum of 2*3^n - 1. Examples: [3,5], [7,11,17], [15,23,35,53], ..., [127,191,287,431,647,971,1457]. - Lambert Klasen, Mar 11 2005
%C Group the natural numbers so that the (2n-1)-th group sum is a multiple of the (2n)-th group containing one term. (1,2),(3),(4,5,6,7,8,9,10,11),(12),(13,14,15,16,17,18,19,...,38),(39),(40,41,...,118,119),(120), (121,122,123,...) ... a(n) = {the sum of the terms of (2n-1)-th group}/{the term of (2n)th group}. The first term of the odd numbered group is given by A003462. The only term of even numbered group is given by A029858. - _Amarnath Murthy_, Aug 01 2005
%C a(n)+1 = A008776(n); it appears that this gives the number of terms in the (n+1)-th "gap" of numbers missing in A171884. - _M. F. Hasler_, May 09 2013
%C Sum of n-th row of triangle of powers of 3: 1; 1 3 1; 1 3 9 3 1; 1 3 9 27 9 3 1; ... - _Philippe Deléham_, Feb 23 2014
%C For n >= 3, also the number of dominating sets in the n-helm graph. - _Eric W. Weisstein_, May 28 2017
%C The number of elements of length <= n in the free group on two generators. - _Anton Mellit_, Aug 10 2017
%C In general, a first order inhomogeneous recurrence of the form s(0) = a, s(n)= m*s(n-1) + k, n>0, will have a closed form of a*m^n +((m^n-1)/(m-1))*k. - _Gary Detlefs_, Jun 07 2024
%D Theoni Pappas, Math Stuff, Wide World Publ/Tetra, San Carlos CA, page 15, 2002
%H Vincenzo Librandi, <a href="/A048473/b048473.txt">Table of n, a(n) for n = 0..1000</a>
%H Creighton Dement, <a href="https://mathforum.org/kb/thread.jspa?forumID=13&threadID=1962419">A paper on floretions and quaternions, some questions</a>, The Math Forum.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DominatingSet.html">Dominating Set</a>
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HelmGraph.html">Helm Graph</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (4,-3).
%F n-th difference of a(n), a(n-1), ..., a(0) is 2^(n+1) for n=1, 2, 3, ...
%F a(0)=1, a(n) = a(n-1) + 3^n + 3^(n-1). - Lee Reeves, May 10 2004
%F a(n) = (3^n + 3^(n+1) - 2)/2. - _Creighton Dement_, Jul 31 2004
%F (1, 5, 17, 53, 161, ...) = Ternary (1, 12, 122, 1222, 12222, ...). - _Gary W. Adamson_, May 02 2005
%F Row sums of triangle A134347. Also, binomial transform of A046055: (1, 4, 8, 16, 32, 64, ...); and double binomial transform of A010684: (1, 3, 1, 3, 1, 3, ...). - _Gary W. Adamson_, Oct 21 2007
%F G.f.:(1+x)/((1-3*x)(1-x)). - _Zerinvary Lajos_, Jan 11 2009; corrected by _R. J. Mathar_, Jan 21 2009
%F a(0)=1, a(1)=5, a(n) = 4*a(n-1) - 3*a(n-2). - _Harvey P. Dale_, Mar 06 2012
%F a(n) = Sum_{k=0..n} A112468(n,k)*4^k. - _Philippe Deléham_, Feb 23 2014
%e a(0) = 1;
%e a(1) = 1 + 3 + 1 = 5;
%e a(2) = 1 + 3 + 9 + 3 + 1 = 17;
%e a(3) = 1 + 3 + 9 + 27 + 9 + 3 + 1 = 53; etc. - _Philippe Deléham_, Feb 23 2014
%p g:= ((1+x)/(1-3*x)/(1-x)): gser:=series(g, x=0, 43): seq(coeff(gser, x, n), n=0..30); # _Zerinvary Lajos_, Jan 11 2009; typo fixed by Marko Mihaily, Mar 07 2009
%t NestList[3 # + 2 &, 1, 30] (* _Harvey P. Dale_, Mar 06 2012 *)
%t LinearRecurrence[{4, -3}, {1, 5}, 30] (* _Harvey P. Dale_, Mar 06 2012 *)
%t Table[2 3^n - 1, {n, 20}] (* _Eric W. Weisstein_, May 28 2017 *)
%t 2 3^Range[20] - 1 (* _Eric W. Weisstein_, May 28 2017 *)
%o (Magma) [2*3^n - 1: n in [0..30]]; // _Vincenzo Librandi_, Sep 23 2011
%o (PARI) first(m)=vector(m,n,n--;2*3^n - 1) \\ _Anders Hellström_, Dec 11 2015
%Y a(n)=T(2, n), array T given by A048471.
%Y Cf. A003462, A029858. A column of A119725.
%Y Cf. A134347, A046055, A010684.
%Y Cf. A112468, A112739.
%K nonn,easy
%O 0,2
%A _Clark Kimberling_
%E Better description from _Amarnath Murthy_, May 27 2001