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-3 of 3 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.]

A227177 n occurs n^2 - n + 1 times.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 03 2013

Keywords

Comments

a(n) is the least integer k such that A006527(k) >= n, which implies that each n occurs A002061(n) times.

Crossrefs

Programs

  • Mathematica
    Flatten[Map[ConstantArray[#,(#-2) (#-1)+1]-1&,Range[7]]] (* Peter J. C. Moses, Jul 14 2013 *)
    Flatten[Table[#,{#^2-#+1}]&/@Range[0,7]] (* Harvey P. Dale, Sep 25 2013 *)
  • PARI
    vec(N)=concat(vector(N, i, vector(i^2-i+1, j, i))) \\ Jinyuan Wang, Dec 01 2018
    
  • Python
    from sympy import integer_nthroot
    def A227177(n): return (m:=integer_nthroot(k:=3*n,3)[0])+(k>m*(m**2+2)) # Chai Wah Wu, Nov 07 2024

Formula

a(k + (j^3-j^2+5*j)/3) = j for all j>=0, k=0..(j^2-j). - Jinyuan Wang, Nov 24 2018
a(n) = m+1 if 3n>m*(m^2+2) and a(n) = m otherwise where m=floor((3n)^(1/3)). - Chai Wah Wu, Nov 07 2024

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)).
Showing 1-3 of 3 results.