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.

A028931 Strings giving winning positions in Tchoukaillon (or Mancala) solitaire.

Original entry on oeis.org

0, 1, 20, 21, 310, 311, 4200, 4201, 4220, 4221, 53110, 53111, 642000, 642001, 642020, 642021, 642310, 642311, 7531200, 7531201, 7531220, 7531221, 86420110, 86420111, 86424000, 86424001, 86424020, 86424021, 86424310, 86424311
Offset: 0

Views

Author

Keywords

Comments

a(n) gives string listing winning position for n stones.
Sum of numbers in a(n) is equal to n.
Using the chromatic (tet-12) scale, (if C=0, 12, 24...) all integers correspond to pitches C, C#, G#, A, Bb, B, a recursive pattern that evenly bisects the octave and avoids the tritone (IC6). - Nik Bizzell-Browning, Apr 27 2019

Examples

			For example, a(10) = 53111; rightmost 0 is in position 6, so get 653111 -> a(11) = 642000.
		

Crossrefs

Programs

  • Mathematica
    a[1] = {0};a[n_]:=a[n]=Module[{gs=a[n-1],len=Length[a[n-1]],pos},If[FreeQ[gs,0],Prepend[gs-1,1+len],pos=FirstPosition[Reverse[gs],0][[1]];(gs[[;;len-pos]])~Join~{pos}~Join~If[pos==1,{},(gs[[len-pos+2;;]]-1)]]];StringJoin/@Map[ToString, Array[a, 30], {2}] (* Shenghui Yang, Jun 06 2025 *)

Formula

To get the next term, if rightmost 0 is in position i, replace it by i and subtract 1 from all earlier entries.

Extensions

More terms from Erich Friedman