login
a(n) = 3^n - (-1)^n.
9

%I #41 Sep 08 2022 08:45:17

%S 0,4,8,28,80,244,728,2188,6560,19684,59048,177148,531440,1594324,

%T 4782968,14348908,43046720,129140164,387420488,1162261468,3486784400,

%U 10460353204,31381059608,94143178828,282429536480,847288609444,2541865828328,7625597484988

%N a(n) = 3^n - (-1)^n.

%H Muniru A Asiru, <a href="/A105723/b105723.txt">Table of n, a(n) for n = 0..2000</a>

%H Dhroova Aiylam, Tanya Khovanova, <a href="https://arxiv.org/abs/1711.01475">Weighted Mediants and Fractals</a>, arXiv:1711.01475 [math.NT], 2017. See p. 17.

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

%F a(n) = A102345(n) - 2*(-1)^n; (a(n) + A102345(n))/2 = A000244(n);

%F A007814(a(n)) = A085058(n-1) for n > 0.

%F E.g.f.: exp(3*x) - exp(-x). - _G. C. Greubel_, Nov 21 2018

%F G.f.: 4*x/((1+x)*(1-3*x)). - _R. J. Mathar_, Mar 08 2021

%F a(n) = 4*A015518(n). - _R. J. Mathar_, Mar 08 2021

%t LinearRecurrence[{2, 3}, {0, 4}, 30] (* _Jean-François Alcover_, Nov 11 2018 *)

%t Table[3^n - (-1)^n, {n, 0, 30}] (* _Vincenzo Librandi_, Nov 21 2018 *)

%o (PARI) a(n) = 3^n - (-1)^n; \\ _Michel Marcus_, Aug 18 2017

%o (GAP) List([0..25],n->3^n-(-1)^n); # _Muniru A Asiru_, Nov 11 2018

%o (Magma) [3^n-(-1)^n: n in [0..30]]; // _Vincenzo Librandi_, Nov 21 2018

%o (Sage) [3^n - (-1)^n for n in range(30)] # _G. C. Greubel_, Nov 21 2018

%Y Cf. A000244, A102345.

%Y Cf. A007814, A085058.

%K nonn,easy

%O 0,2

%A _Reinhard Zumkeller_, Apr 18 2005

%E Corrected by _T. D. Noe_, Dec 11 2006