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.

Previous Showing 11-15 of 15 results.

A123975 Number of Garden of Eden partitions of n in Bulgarian Solitaire.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 5, 7, 10, 14, 20, 27, 37, 49, 66, 86, 113, 147, 190, 243, 311, 394, 499, 627, 786, 980, 1220, 1510, 1865, 2294, 2816, 3443, 4202, 5110, 6203, 7507, 9067, 10923, 13135, 15755, 18865, 22540, 26885, 32001, 38032, 45112, 53430, 63171
Offset: 1

Views

Author

Vladeta Jovovic, Nov 23 2006

Keywords

Comments

a(n) gives the number of times n occurs in A225794. - Antti Karttunen, Jul 27 2013

Crossrefs

Programs

  • Maple
    p:=product(1/(1-q^i), i=1..200)*sum((-1)^(r-1)*q^((3*r^2+3*r)/2), r=1..200):s:=series(p, q, 200): for j from 0 to 199 do printf(`%d,`,coeff(s, q, j)) od: # James Sellers, Nov 30 2006
  • PARI
    my(N=50, x='x+O('x^N)); concat([0, 0], Vec(1/prod(k=1, N, 1-x^k)*sum(k=1, N, (-1)^(k-1)*x^(3*k*(k+1)/2)))) \\ Seiichi Manyama, May 21 2023

Formula

a(n) = A064173(n) - A101198(n).
a(n) = Sum_{j>=1} (-1)^(j+1)*p(n-b(j)) where b(j) = 3*j*(j+1)/2 (A045943) and p(n) is the number of partitions of n (see A000041). See Hopkins & Sellers. - Michel Marcus, Sep 26 2018
a(n) ~ exp(Pi*sqrt(2*n/3)) / (8*n*sqrt(3)) * (1 - (1/(2*Pi) + 19*Pi/144) / sqrt(n/6)). - Vaclav Kotesovec, May 26 2023

Extensions

More terms from James Sellers, Nov 30 2006

A227452 Irregular table where each row lists the partitions occurring on the main trunk of the Bulgarian Solitaire game tree (from the top to the root) for deck of n(n+1)/2 cards. Nonordered partitions are encoded in the runlengths of binary expansion of each term, in the manner explained in A129594.

Original entry on oeis.org

0, 1, 5, 7, 6, 18, 61, 8, 11, 58, 28, 25, 77, 246, 66, 55, 36, 237, 226, 35, 46, 116, 197, 115, 102, 306, 985, 265, 445, 200, 155, 946, 905, 285, 220, 145, 475, 786, 925, 140, 185, 465, 395, 826, 460, 409, 1229, 3942, 1062, 1782, 1602, 823, 612, 3789, 3622, 1142
Offset: 0

Views

Author

Antti Karttunen, Jul 12 2013

Keywords

Comments

The terms for row n are computed as A227451(n), A226062(A227451(n)), A226062(A226062(A227451(n))), etc. until a term that is a fixed point of A226062 is reached (A037481(n)), which will be the last term of row n.
Row n has A002061(n) = 1,1,3,7,13,21,... terms.

Examples

			Rows 0 - 5 of the table are:
0
1
5, 7, 6
18, 61, 8, 11, 58, 28, 25
77, 246, 66, 55, 36, 237, 226, 35, 46, 116, 197, 115, 102
306, 985, 265, 445, 200, 155, 946, 905, 285, 220, 145, 475, 786, 925, 140, 185, 465, 395, 826, 460, 409
		

References

  • Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.

Crossrefs

Left edge A227451. Right edge: A037481. Cf. A227147 (can be computed from this sequence).

Programs

  • Scheme
    ;; with Antti Karttunen's IntSeq-library for memoizing definec-macro
    ;; Compare with the other definition for A218616:
    (definec (A227452 n) (cond ((< n 2) n) ((A226062 (A227452 (- n 1))) => (lambda (next) (if (= next (A227452 (- n 1))) (A227451 (A227177 (+ 1 n))) next)))))
    ;; Alternative implementation using nested cached closures for function iteration:
    (define (A227452 n) ((compose-A226062-to-n-th-power (A227179 n)) (A227451 (A227177 n))))
    (definec (compose-A226062-to-n-th-power n) (cond ((zero? n) (lambda (x) x)) (else (lambda (x) (A226062 ((compose-A226062-to-n-th-power (- n 1)) x))))))

Formula

For n < 2, a(n) = n, and for n>=2, if A226062(a(n-1)) = a(n-1) [in other words, when a(n-1) is one of the terms of A037481] then a(n) = A227451(A227177(n+1)), otherwise a(n) = A226062(a(n-1)).
Alternatively, a(n) = value of the A227179(n)-th iteration of the function A226062, starting from the initial value A227451(A227177(n)). [See the other Scheme-definition in the Program section]

A225794 Sizes of Garden of Eden partitions in Bulgarian Solitaire, given in the same order as the runlength codes of the corresponding partitions (A227753).

Original entry on oeis.org

3, 4, 6, 8, 5, 7, 5, 7, 9, 6, 10, 8, 6, 9, 11, 8, 12, 10, 13, 10, 14, 12, 7, 11, 15, 12, 9, 13, 11, 8, 10, 7, 11, 9, 7, 10, 12, 14, 9, 13, 11, 14, 16, 11, 15, 18, 13, 8, 14, 17, 12, 16, 13, 15, 10, 14, 12, 9, 11, 13, 8, 12, 10, 8, 12, 14, 16, 11, 15, 13, 16, 18
Offset: 1

Views

Author

Antti Karttunen, Jul 27 2013

Keywords

Comments

Each n occurs A123975(n) times in total.

Crossrefs

Programs

Formula

a(n) = A227183(A227753(n)).

A229119 a(n) is the (reversed lexicographic, alias Mathematica ordering) rank of the partition associated with integer n by encoding the run lengths of the binary representation of n.

Original entry on oeis.org

1, 3, 2, 9, 6, 5, 4, 23, 16, 11, 26, 14, 10, 8, 7, 52, 37, 27, 57, 62, 18, 41, 85, 34, 24, 17, 38, 21, 15, 13, 12, 109, 79, 58, 116, 126, 42, 86, 168, 253, 92, 29, 133, 179, 63, 125, 238, 74, 53, 39, 80, 88, 28, 59, 118, 49, 35, 25, 54, 32, 22, 20, 19, 214, 158, 117, 225, 240, 87, 169, 316, 463, 181, 64, 256, 335, 127, 239, 438, 851, 352, 134, 484, 265, 44, 189, 657, 630, 254, 93, 353, 461, 180, 334, 600, 151, 110, 81, 159, 172, 60
Offset: 1

Views

Author

Wouter Meeussen, Sep 14 2013

Keywords

Comments

Defines an infinite permutation on the integers, containing cycles of infinite length, but with an inverse (A229120) that can be generated.
The least integer producing an infinite cycle is n=4: {4, 9, 16, 52, 88, 630, 1931, 1031, 2908, 53102, ...}.

Examples

			The partition associated with 24 is found as follows (see A226062):
Write 24 in binary as 11000; the run lengths are 2,3.
Now subtract 1 from all but the last integer, giving 1,3.
Now reverse to 3,1; take running sum giving 3,4 and reverse again to partition {4,3};
Finally, note that {4,3} is the 5th partition of 7, and the 34th partition overall.
This shows that a(24)=34.
		

Crossrefs

Cf. A226062.

Programs

  • Mathematica
      << Combinatorica`; rankpartition[(p_)?PartitionQ] := PartitionsP[Tr[p]] -Sum[(NumberOfPartitions[Tr[#1], First[#1]-1]& )[Drop[p,k]],
    {k,0,Length[p]-1}]; rankpartition[par_?PartitionQ,All]:=Tr[PartitionsP[Range[Tr[par]-1]]]+rankpartition[par];
    int2par[n_Integer]:=Block[{t0,t1,t2},t0=Length/@Split[IntegerDigits[n,2]];t1=Reverse@MapAt[#+1&,-1+t0,-1];t2=FoldList[Plus,First[t1], Rest[t1]];Reverse[t2]];
    a=Table[ rankpartition[#,All]& @ int2par[n],{n,138}]

A229120 Inverse of permutation A229119.

Original entry on oeis.org

1, 3, 2, 7, 6, 5, 15, 14, 4, 13, 10, 31, 30, 12, 29, 9, 26, 21, 63, 62, 28, 61, 8, 25, 58, 11, 18, 53, 42, 127, 126, 60, 125, 24, 57, 122, 17, 27, 50, 117, 22, 37, 106, 85, 255, 254, 124, 253, 56, 121, 250, 16, 49, 59, 114, 245, 19, 34, 54, 101, 234, 20, 45, 74, 213, 170, 511, 510, 252, 509, 120, 249, 506, 48
Offset: 1

Views

Author

Wouter Meeussen, Sep 14 2013

Keywords

Comments

Defines an infinite permutation on the integers, containing cycles of infinite length, but with an inverse (A229119) that can be generated.
The least integer producing an infinite cycle is n=4: {4, 7, 15, 29, 42, 37, 17, 26, 11, 10, 13, 30, 127, 77, 242, 266, 173, 205, 2034, 6474, ...}.

Examples

			See A229119.
		

Crossrefs

Cf. A226062.

Programs

  • Mathematica
    << Combinatorica`; unrankpartition[n_Integer, k_Integer] := Block[{ove, res, qq, zz, mem}, ove=PartitionsP[n]-k; res={}; While[n-Tr[res]>0, qq=0; zz=0; While[(mem=NumberOfPartitions[n-Tr[res], qq + 1]) <= ove, zz = mem; qq++]; AppendTo[res, qq + 1]; ove = ove-zz]; res] /; k <= PartitionsP[n] && k > 0; unrankpartition[n_Integer,All]:=Block[{k=1,z},While[( z=Tr[PartitionsP[Range@k]])
    				
Previous Showing 11-15 of 15 results.