%I #72 Jul 23 2024 19:43:44
%S 0,1,8,49,272,1441,7448,37969,192032,966721,4853288,24325489,
%T 121804592,609554401,3049366328,15251614609,76272421952,381405156481,
%U 1907154922568,9536162033329,47681972428112,238413348924961,1192077204978008,5960417405949649,29802181172927072
%N a(n) = (5^n - 3^n)/2.
%C Number of lines passing through 3 points of an n-dimensional grid of points of side 3. - _David W. Wilson_, c. 1999
%C a(n) is also the total number of words of length n, over an alphabet of five letters, one of them appearing an odd number of times. See the Lekraj Beedassy, Jul 22 2003, comment under A006516 (4-letter words), and the Balakrishnan reference there. See A003462 for the analogous 3-letter words problem. - _Wolfdieter Lang_, Jul 16 2017
%H Vincenzo Librandi, <a href="/A005059/b005059.txt">Table of n, a(n) for n = 0..1000</a>
%H M. A. Alekseyev and T. Berger, <a href="http://arxiv.org/abs/1304.3780">Solving the Tower of Hanoi with Random Moves</a>. In: J. Beineke, J. Rosenhouse (eds.) The Mathematics of Various Entertaining Subjects: Research in Recreational Math, Princeton University Press, 2016, pp. 65-79. ISBN 978-0-691-16403-8
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (8,-15).
%F From _Paul Barry_, Mar 03 2003: (Start)
%F a(n) = 8*a(n-1) - 15*a(n-2).
%F G.f.: x/((1-3*x)*(1-5*x)). (End)
%F a(n) = Sum_{k=1..n} 2^(k-1)*3^(n-k)*binomial(n,k). - _Zerinvary Lajos_, Sep 24 2006
%F a(n) = (r^n-s^n)/(r-s) with r=5 and s=3. - _Sture Sjöstedt_, Oct 17 2012
%F a(n) = Sum_{k=0..n-1} 3^k*5^(n-k-1) for n>0, a(0)=0. - _Bruno Berselli_, Aug 07 2013
%F E.g.f.: exp(3*x)*(exp(2*x) - 1)/2. - _Stefano Spezia_, Jul 23 2024
%e For the fifth formula: a(4) = 1*125 + 3*25 + 9*5 + 27*1 = 272. [_Bruno Berselli_, Aug 07 2013]
%p A005059:=n->(5^n-3^n)/2: seq(A005059(n), n=0..30); # _Wesley Ivan Hurt_, Nov 18 2014
%t Join[{a=0,b=1},Table[c=8*b-15*a;a=b;b=c,{n,60}]] (* _Vladimir Joseph Stephan Orlovsky_, Jan 19 2011 *)
%t LinearRecurrence[{8, -15}, {0, 1}, 50] (* _Sture Sjöstedt_, Oct 17 2012 *)
%t Table[(5^n - 3^n)/2, {n, 0, 23}] (* _Michael De Vlieger_, Jul 16 2017 *)
%o (Sage) [lucas_number1(n,8,15) for n in range(0, 21)] # _Zerinvary Lajos_, Apr 23 2009
%o (Magma) [(5^n - 3^n)/2: n in [0..30] ]; // _Vincenzo Librandi_, Aug 19 2011
%o (PARI) a(n)=(5^n-3^n)/2 \\ _Charles R Greathouse IV_, Jun 11 2013
%Y Cf. A081199 (binomial transform), A006516 (inverse binomial transform, and special 4-letter words), A003462 (special 3-letter words).
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_