A227451 Number whose binary expansion encodes via runlengths the partition that is at the top of the main trunk of Bulgarian solitaire game tree drawn for the deck with n(n+1)/2 cards.
0, 1, 5, 18, 77, 306, 1229, 4914, 19661, 78642, 314573, 1258290, 5033165, 20132658, 80530637, 322122546, 1288490189, 5153960754, 20615843021, 82463372082, 329853488333, 1319413953330, 5277655813325, 21110623253298, 84442493013197, 337769972052786, 1351079888211149
Offset: 0
References
- Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.
Links
- Antti Karttunen, Table of n, a(n) for n = 0..1000
- Wikipedia, Bulgarian solitaire
- Index entries for linear recurrences with constant coefficients, signature (4,1,-4).
Programs
-
Mathematica
LinearRecurrence[{4,1,-4},{0,1,5,18,77},40] (* Harvey P. Dale, Sep 22 2016 *)
-
PARI
a(n)=if(n<1,0,if(n==1,1,(3*4^n+7*(-1)^n-5)/10)) \\ Ralf Stephan
Formula
a(0)=0, a(1)=1, for n>=2, a(n) = A053645(2*A037481(n)) + (1 - (n mod 2)). [Follows from the "insert 1 and decrement the largest part by one" operation on triangular partitions]
Alternatively:
a(0)=0, a(1)=1, and for n>=2, if n is even, then a(n) = 1 + (4*A182512((n-2)/2)) + 2^(2*(n-1)), and if n is odd, then a(n) = 2 + (16*A182512((n-3)/2)) + 2^(2*(n-1)).
From Ralf Stephan, Jul 20 2013: (Start)
a(n) = (1/10) * (3*4^n + 7*(-1)^n - 5).
a(n) = 4*a(n-1) + a(n-2) - 4*a(n-3), n>3.
G.f.: (4*x^4 - 3*x^3 + x^2 + x)/((1-x)*(1+x)*(1-4*x)). (End)
Comments