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.

A037481 Base 4 digits are, in order, the first n terms of the periodic sequence with initial period 1,2.

This page as a plain text file.
%I A037481 #52 Jun 28 2023 14:45:03
%S A037481 0,1,6,25,102,409,1638,6553,26214,104857,419430,1677721,6710886,
%T A037481 26843545,107374182,429496729,1717986918,6871947673,27487790694,
%U A037481 109951162777,439804651110,1759218604441,7036874417766,28147497671065
%N A037481 Base 4 digits are, in order, the first n terms of the periodic sequence with initial period 1,2.
%C A037481 The terms have a particular pattern in their binary expansion, which encodes for a "triangular partition" when runlength encoding of unordered partitions are used (please see A129594 for how that encoding works).
%C A037481   n   a(n)    same in binary           run lengths   unordered partition
%C A037481   0      0                 0                    []                    {}
%C A037481   1      1                 1                   [1]                   {1}
%C A037481   2      6               110                 [2,1]                 {1+2}
%C A037481   3     25             11001               [2,2,1]               {1+2+3}
%C A037481   4    102           1100110             [2,2,2,1]             {1+2+3+4}
%C A037481   5    409         110011001           [2,2,2,2,1]           {1+2+3+4+5}
%C A037481   6   1638       11001100110         [2,2,2,2,2,1]         {1+2+3+4+5+6}
%C A037481   7   6553     1100110011001       [2,2,2,2,2,2,1]       {1+2+3+4+5+6+7}
%C A037481   8  26214   110011001100110     [2,2,2,2,2,2,2,1]     {1+2+3+4+5+6+7+8}
%C A037481   9 104857 11001100110011001   [2,2,2,2,2,2,2,2,1]   {1+2+3+4+5+6+7+8+9}
%C A037481 These partitions are the only fixed points of "Bulgarian Solitaire" operation (see Gardner reference or Wikipedia page), and thus the terms of this sequence give the fixed points for A226062 which implements that operation (using the same encoding for partitions). This also implies that these partitions are the roots of the game trees constructed for decks consisting of 1+2+3+...+k cards. See A227451 for the encoding of the corresponding tops of the main trunks of the same trees. - _Antti Karttunen_, Jul 12 2013
%D A037481 Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.
%H A037481 Vincenzo Librandi, <a href="/A037481/b037481.txt">Table of n, a(n) for n = 0..1000</a>
%H A037481 Wikipedia, <a href="http://en.wikipedia.org/wiki/Bulgarian_solitaire">Bulgarian solitaire</a>
%H A037481 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (4,1,-4).
%F A037481 a(n) = ((4^(n+1) - (-1)^(n+1))/5 - 1)/2. - _Ralf Stephan_
%F A037481 a(n) = 4*a(n-1) + a(n-2) - 4*a(n-3). - _Vincenzo Librandi_, Jun 21 2012
%F A037481 a(n) = A226062(A129594(A227451(n))). [See page 465 in Gardner's book] - _Antti Karttunen_, Jul 12 2013
%F A037481 G.f.: x*(2*x+1) / ((x-1)*(x+1)*(4*x-1)). - _Colin Barker_, Apr 30 2014
%t A037481 LinearRecurrence[{4,1,-4},{0,1,6},40] (* _Vincenzo Librandi_, Jun 21 2012 *)
%t A037481 Module[{nn=30,ps},ps=PadRight[{},nn,{1,2}];Table[FromDigits[Take[ps,n],4],{n,0,nn}]] (* _Harvey P. Dale_, Jul 18 2013 *)
%o A037481 (Magma) I:=[0, 1, 6]; [n le 3 select I[n] else 4*Self(n-1)+Self(n-2)-4*Self(n-3): n in [1..30]]; // _Vincenzo Librandi_, Jun 21 2012
%o A037481 (Scheme) (define (A037481 n) (/ (- (/ (+ (expt 4 (1+ n)) (expt -1 n)) 5) 1) 2)) ;; Using _Ralf Stephan_'s direct formula - _Antti Karttunen_, Jul 12 2013
%o A037481 (PARI) concat(0, Vec(x*(2*x+1)/((x-1)*(x+1)*(4*x-1)) + O(x^100))) \\ _Colin Barker_, Apr 30 2014
%o A037481 (PARI) a(n) = 2<<(2*n) \ 5; \\ _Kevin Ryde_, Jun 24 2023
%o A037481 (Python)
%o A037481 def A037481(n): return (1<<(n<<1|1))//5 # _Chai Wah Wu_, Jun 28 2023
%Y A037481 Cf. A014985, A015521, A227451.
%Y A037481 Cf. A037487 (decimal digits 1,2).
%Y A037481 The right edge of the table A227452. The fixed points of A226062.
%K A037481 nonn,base,easy
%O A037481 0,3
%A A037481 _Clark Kimberling_