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.

Showing 1-5 of 5 results.

A227147 Irregular table: palindromic subsections from the rows of array A227141 related to main trunks of game trees drawn for Bulgarian solitaire.

Original entry on oeis.org

1, 1, 3, 1, 2, 4, 3, 2, 3, 4, 2, 3, 5, 4, 4, 3, 4, 5, 4, 3, 4, 4, 5, 3, 4, 6, 5, 5, 5, 4, 5, 6, 5, 5, 4, 5, 5, 6, 5, 4, 5, 5, 5, 6, 4, 5, 7, 6, 6, 6, 6, 5, 6, 7, 6, 6, 6, 5, 6, 6, 7, 6, 6, 5, 6, 6, 6, 7, 6, 5, 6, 6, 6, 6, 7, 5, 6, 8, 7, 7, 7, 7, 7, 6, 7, 8, 7
Offset: 1

Views

Author

Antti Karttunen, Jul 03 2013

Keywords

Comments

Each row n contains A002061(n) terms and is palindromic.
Apart from the last term, each term on row n gives the largest summand in the partitions encountered on the main trunk of the Bulgarian solitaire tree computed for the deck of n(n+1)/2 cards; from row 2 onward, the last term of row k is one less than the largest summand in the unordered triangular partition {1+2+...+k} that is at the root of each game tree of the deck of the same size. The function f(n) = A227185(A227452(n)) would correctly give the largest summand sizes also for those cases.

Examples

			Rows 1-6 of the table are:
1
1, 3, 1
2, 4, 3, 2, 3, 4, 2
3, 5, 4, 4, 3, 4, 5, 4, 3, 4, 4, 5, 3
4, 6, 5, 5, 5, 4, 5, 6, 5, 5, 4, 5, 5, 6, 5, 4, 5, 5, 5, 6, 4
5, 7, 6, 6, 6, 6, 5, 6, 7, 6, 6, 6, 5, 6, 6, 7, 6, 6, 5, 6, 6, 6, 7, 6, 5, 6, 6, 6, 6, 7, 5
		

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

Programs

Formula

a(n) = A227141(A227177(n),A227181(n)). [As a sequence. Each row n is a subsequence from the section [n,n^2] of the n-th row of ordinary table A227141.]
;; The following two formulas use the table A227452:
a(n) = A227185(A227452(n)) - ([n>1] * (A227177(n+1) - A227177(n))). [Where the expression [n>1] is an instance of Iverson brackets]
a(n) = n when n<2, otherwise a(n) = A005811(A227452(n-1)).
For all n, a(n) = a(A227182(n)). [This is just a claim that each row is symmetric.]

A227179 After initial 0, integers from 0 to n(n-1) followed by integers from 0 to n(n+1) and so on.

Original entry on oeis.org

0, 0, 0, 1, 2, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
Offset: 0

Views

Author

Antti Karttunen, Jul 03 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[(Range[(#-2) (#-1)+1]-1&)[Range[7]]] (* Peter J. C. Moses, Jul 11 2013 *)
  • Python
    from sympy import integer_nthroot
    def A227179(n): return n-1-(f:=lambda x:x*(x**2+2))((m:=integer_nthroot(k:=3*n,3)[0])-(k<=f(m)))//3 # Chai Wah Wu, Nov 07 2024
  • Scheme
    (define (A227179 n) (- n (+ 1 (A006527 (- (A227177 n) 1)))))
    

Formula

a(n) = n - (1 + A006527(A227177(n)-1)).

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]

A227181 Irregular table: integers from n to n^2 followed by integers from (n+1) to (n+1)^2.

Original entry on oeis.org

0, 1, 2, 3, 4, 3, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36
Offset: 0

Views

Author

Antti Karttunen, Jul 03 2013

Keywords

Examples

			Row n is A002061(n) terms long, and contains successive integers from n to n*n:
  0;
  1;
  2, 3, 4;
  3, 4, 5, 6, 7, 8, 9;
  4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16;
  ...
		

Crossrefs

Right edge: A000290. Central diagonal: A000217. Cf. also A227147.

Programs

  • Mathematica
    Flatten[(#+Range[(#1-2) (#1-1)+1]-2&)[Range[7]]] (* Peter J. C. Moses, Jul 11 2013 *)
    Table[Range[n,n^2],{n,0,6}]//Flatten (* Harvey P. Dale, Apr 03 2021 *)
  • Python
    from sympy import integer_nthroot
    def A227181(n): return n-(r:=(m:=integer_nthroot(k:=3*n,3)[0])-(k<=m*(m**2+2)))*(r**2-1)//3 # Chai Wah Wu, Nov 07 2024
  • Scheme
    (define (A227181 n) (+ (A227177 n) (A227179 n)))
    

Formula

a(n) = A227177(n)+ A227179(n). [As a sequence].

A227182 Simple self-inverse permutation of natural numbers: List each block of n^2 - n + 1 numbers from ((n-1)^3 + 2*(n-1))/3 + 1 to (n^3 + 2*n)/3 in reverse order.

Original entry on oeis.org

0, 1, 4, 3, 2, 11, 10, 9, 8, 7, 6, 5, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46
Offset: 0

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Comments

In other words, after zero, list each block of A002061(n) numbers from A116731(n) to A006527(n) in reverse order.

Crossrefs

Programs

Formula

a(n) = A006527(A227177(n)) - A227179(n).
Showing 1-5 of 5 results.