cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A227451 #30 Nov 03 2024 05:02:04
%S A227451 0,1,5,18,77,306,1229,4914,19661,78642,314573,1258290,5033165,
%T A227451 20132658,80530637,322122546,1288490189,5153960754,20615843021,
%U A227451 82463372082,329853488333,1319413953330,5277655813325,21110623253298,84442493013197,337769972052786,1351079888211149
%N 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.
%C A227451 The terms have particular patterns in their binary expansion, which encodes for an "almost triangular partition" when runlength encoding of unordered partitions are used (please see A129594 for how that encoding works). These are obtained from the perfectly triangular partitions shown in A037481 by inserting 1 to the front of the partition and decrementing the last summand (the largest) by one:
%C A227451   n   a(n)    same in binary           run lengths   unordered partition
%C A227451   0      0                 0                    []                    {}
%C A227451   1      1                 1                   [1]                   {1}
%C A227451   2      5               101               [1,1,1]               {1+1+1}
%C A227451   3     18             10010             [1,2,1,1]             {1+1+2+2}
%C A227451   4     77           1001101           [1,2,2,1,1]           {1+1+2+3+3}
%C A227451   5    306         100110010         [1,2,2,2,1,1]         {1+1+2+3+4+4}
%C A227451   6   1229       10011001101       [1,2,2,2,2,1,1]       {1+1+2+3+4+5+5}
%C A227451   7   4914     1001100110010     [1,2,2,2,2,2,1,1]     {1+1+2+3+4+5+6+6}
%C A227451   8  19661   100110011001101   [1,2,2,2,2,2,2,1,1]   {1+1+2+3+4+5+6+7+7}
%C A227451   9  78642 10011001100110010 [1,2,2,2,2,2,2,2,1,1] {1+1+2+3+4+5+6+7+8+8}
%C A227451 These partitions occur at the tops of the main trunks of the game trees constructed for decks consisting of 1+2+3+...+k cards. See A037481 for the encoding of the roots of the main trunks of the same trees.
%D A227451 Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.
%H A227451 Antti Karttunen, <a href="/A227451/b227451.txt">Table of n, a(n) for n = 0..1000</a>
%H A227451 Wikipedia, <a href="http://en.wikipedia.org/wiki/Bulgarian_solitaire">Bulgarian solitaire</a>
%H A227451 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (4,1,-4).
%F A227451 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]
%F A227451 Alternatively:
%F A227451 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)).
%F A227451 From _Ralf Stephan_, Jul 20 2013: (Start)
%F A227451 a(n) = (1/10) * (3*4^n + 7*(-1)^n - 5).
%F A227451 a(n) = 4*a(n-1) + a(n-2) - 4*a(n-3), n>3.
%F A227451 G.f.: (4*x^4 - 3*x^3 + x^2 + x)/((1-x)*(1+x)*(1-4*x)). (End)
%t A227451 LinearRecurrence[{4,1,-4},{0,1,5,18,77},40] (* _Harvey P. Dale_, Sep 22 2016 *)
%o A227451 (Scheme, two variants)
%o A227451 (define (A227451 n) (if (< n 2) n (+ (A053645 (* 2 (A037481 n))) (- 1 (modulo n 2)))))
%o A227451 (define (A227451v2 n) (cond ((< n 2) n) ((even? n) (+ 1 (* 4 (+ (A182512 (/ (- n 2) 2)))) (expt 2 (* 2 (- n 1))))) (else (+ 2 (* 16 (A182512 (/ (- n 3) 2))) (expt 2 (* 2 (- n 1)))))))
%o A227451 (PARI) a(n)=if(n<1,0,if(n==1,1,(3*4^n+7*(-1)^n-5)/10)) \\ _Ralf Stephan_
%Y A227451 Cf. A037481, A182512.
%Y A227451 The left edge of the table A227452.
%K A227451 nonn,base,easy
%O A227451 0,3
%A A227451 _Antti Karttunen_, Jul 12 2013