[go: up one dir, main page]

login
a(2n) = 3^n, a(2n+1) = 2*3^n.
95

%I #144 Nov 03 2023 00:01:23

%S 1,2,3,6,9,18,27,54,81,162,243,486,729,1458,2187,4374,6561,13122,

%T 19683,39366,59049,118098,177147,354294,531441,1062882,1594323,

%U 3188646,4782969,9565938,14348907,28697814,43046721,86093442,129140163,258280326,387420489

%N a(2n) = 3^n, a(2n+1) = 2*3^n.

%C In general, for the recurrence a(n) = a(n-1)*a(n-2)/a(n-3), all terms are integers iff a(0) divides a(2) and first three terms are positive integers, since a(2n+k) = a(k)*(a(2)/a(0))^n for all nonnegative integers n and k.

%C Equals eigensequence of triangle A070909; (1, 1, 2, 3, 6, 9, 18, ...) shifts to the left with multiplication by triangle A070909. - _Gary W. Adamson_, May 15 2010

%C The a(n) represent all paths of length (n+1), n >= 0, starting at the initial node on the path graph P_5, see the second Maple program. - _Johannes W. Meijer_, May 29 2010

%C a(n) is the difference between numbers of multiple of 3 evil (A001969) and odious (A000069) numbers in interval [0, 2^(n+1)). - _Vladimir Shevelev_, May 16 2012

%C A "half-geometric progression": to obtain a term (beginning with the third one) we multiply the before previous one by 3. - _Vladimir Shevelev_, May 21 2012

%C Pisano periods: 1, 2, 1, 4, 8, 2, 12, 4, 1, 8, 10, 4, 6, 12, 8, 8, 32, 2, 36, 8, ... . - _R. J. Mathar_, Aug 10 2012

%C Numbers k such that the k-th cyclotomic polynomial has a root mod 3. - _Eric M. Schmidt_, Jul 31 2013

%C Range of row n of the circular Pascal array of order 6. - _Shaun V. Ault_, Jun 05 2014

%H Indranil Ghosh, <a href="/A038754/b038754.txt">Table of n, a(n) for n = 0..1500</a> (first 401 terms from T. D. Noe)

%H S. V. Ault and C. Kicey, <a href="http://dx.doi.org/10.1016/j.disc.2014.05.020">Counting paths in corridors using circular Pascal arrays</a>, Discrete Mathematics, Vol. 332 (2014), pp. 45-54.

%H Paul Barry, <a href="https://arxiv.org/abs/1803.06408">Three Études on a sequence transformation pipeline</a>, arXiv:1803.06408 [math.CO], 2018.

%H Nachum Dershowitz, <a href="https://arxiv.org/abs/2006.06516">Between Broadway and the Hudson</a>, arXiv:2006.06516 [math.CO], 2020.

%H Richard L. Ollerton and Anthony G. Shannon, <a href="http://www.fq.math.ca/Scanned/36-2/ollerton.pdf">Some properties of generalized Pascal squares and triangles</a>, Fib. Q., 36 (1998), 98-109. See pages 106-7.

%H Vladimir Shevelev, <a href="http://arxiv.org/abs/0710.3177">On monotonic strengthening of Newman-like phenomenon on (2m+1)-multiples in base 2m</a>, arXiv:0710.3177 [math.NT], 2007.

%H M. B. Wells, <a href="/A000170/a000170.pdf">Elements of Combinatorial Computing</a>, Pergamon, Oxford, 1971. [Annotated scanned copy of pages 237-240]

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,3).

%F a(n) = a(n-1)*a(n-2)/a(n-3) with a(0)=1, a(1)=2, a(2)=3.

%F a(2*n) = (3/2)*a(2*n-1) = 3^n, a(2*n+1) = 2*a(2*n) = 2*3^n.

%F From _Benoit Cloitre_, Apr 27 2003: (Start)

%F a(1)=1, a(n)= 2*a(n-1) if a(n-1) is odd, or a(n)= (3/2)*a(n-1) if a(n-1) is even.

%F a(n) = (1/6)*(5-(-1)^n)*3^floor(n/2).

%F a(2*n) = a(2*n-1) + a(2*n-2) + a(2*n-3).

%F a(2*n+1) = a(2*n) + a(2*n-1). (End)

%F G.f.: (1+2*x)/(1-3*x^2). - _Paul Barry_, Aug 25 2003

%F From _Reinhard Zumkeller_, Sep 11 2003: (Start)

%F a(n) = (1 + n mod 2) * 3^floor(n/2).

%F a(n) = A087503(n) - A087503(n-1). (End)

%F a(n) = sqrt(3)*(2+sqrt(3))*(sqrt(3))^n/6 - sqrt(3)*(2-sqrt(3))*(-sqrt(3))^n/6. - _Paul Barry_, Sep 16 2003

%F From _Reinhard Zumkeller_, May 26 2008: (Start)

%F a(n) = A140740(n+2,2).

%F a(n+1) = a(n) + a(n - n mod 2). (End)

%F If p(i) = Fibonacci(i-3) and if A is the Hessenberg matrix of order n defined by A(i,j) = p(j-i+1), (i<=j), A(i,j)=-1, (i=j+1), and A(i,j)=0 otherwise. Then, for n>=1, a(n-1) = (-1)^n det A. - _Milan Janjic_, May 08 2010

%F a(n) = A182751(n) for n >= 2. - _Jaroslav Krizek_, Nov 27 2010

%F a(n) = Sum_{i=0..2^(n+1), i==0 (mod 3)} (-1)^A000120(i). - _Vladimir Shevelev_, May 16 2012

%F a(0)=1, a(1)=2, for n>=3, a(n)=3*a(n-2). - _Vladimir Shevelev_, May 21 2012

%F Sum_(n>=0) 1/a(n) = 9/4. - _Alexander R. Povolotsky_, Aug 24 2012

%F a(n) = sqrt(3*a(n-1)^2 + (-3)^(n-1)). - _Richard R. Forberg_, Sep 04 2013

%F a(n) = 2^((1-(-1)^n)/2)*3^((2*n-1+(-1)^n)/4). - _Luce ETIENNE_, Aug 11 2014

%F From _Reinhard Zumkeller_, Oct 19 2015: (Start)

%F a(2*n) = A000244(n), a(2*n+1) = A008776(n).

%F For n > 0: a(n+1) = a(n) + if a(n) odd then min{a(n), a(n-1)} else max{a(n), a(n-1)}, see also A128588. (End)

%F E.g.f.: (7*cosh(sqrt(3)*x) + 4*sqrt(3)*sinh(sqrt(3)*x) - 4)/3. - _Stefano Spezia_, Feb 17 2022

%F Sum_{n>=0} (-1)^n/a(n) = 3/4. - _Amiram Eldar_, Dec 02 2022

%e In the interval [0,2^5) we have 11 multiples of 3 numbers, from which 10 are evil and only one (21) is odious. Thus a(4) = 10 - 1 = 9. - _Vladimir Shevelev_, May 16 2012

%p a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=3*a[n-2]+2 od: seq(a[n]+1, n=0..34); # _Zerinvary Lajos_, Mar 20 2008

%p with(GraphTheory): P:=5: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=35; for n from 1 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P) od: seq(a(n),n=1..nmax); # _Johannes W. Meijer_, May 29 2010

%t LinearRecurrence[{0,3},{1,2},40] (* _Harvey P. Dale_, Jan 26 2014 *)

%t CoefficientList[Series[(1+2x)/(1-3x^2), {x, 0, 40}], x] (* _Vincenzo Librandi_, Aug 18 2016 *)

%t Module[{nn=20,c},c=3^Range[0,nn];Riffle[c,2c]] (* _Harvey P. Dale_, Aug 21 2021 *)

%o (PARI) a(n)=(1/6)*(5-(-1)^n)*3^floor(n/2)

%o (PARI) a(n)=3^(n>>1)<<bittest(n,0)

%o (Haskell)

%o import Data.List (transpose)

%o a038754 n = a038754_list !! n

%o a038754_list = concat $ transpose [a000244_list, a008776_list]

%o -- _Reinhard Zumkeller_, Oct 19 2015

%o (Magma) [n le 2 select n else 3*Self(n-2): n in [1..40]]; // _Vincenzo Librandi_, Aug 18 2016

%o (SageMath) [2^(n%2)*3^((n-(n%2))/2) for n in range(61)] # _G. C. Greubel_, Oct 10 2022

%Y Cf. A000045, A000069, A000079, A000120, A000244, A001969, A006720, A006721.

%Y Cf. A006722, A006723, A008776, A028495, A030436, A037124, A048328, A061551.

%Y Cf. A068911, A070909, A087503, A124302, A128588, A133464, A140730, A140740.

%Y Cf. A178381, A182751, A182752, A182753, A182754, A182755, A182756, A182757.

%Y Fifth row of the array A094718.

%K easy,nice,nonn

%O 0,2

%A _Henry Bottomley_, May 03 2000