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-4 of 4 results.

A180238 a(n) is the number of distinct billiard words with length n on an alphabet of 3 symbols.

Original entry on oeis.org

1, 3, 9, 27, 75, 189, 447, 951, 1911, 3621, 6513, 11103, 18267, 29013, 44691, 67251, 98547, 140865, 197679, 272799, 370659, 497403, 658371, 859863, 1110453, 1420527, 1799373, 2260161, 2815401, 3479235, 4269279
Offset: 0

Views

Author

Fred Lunnon, Aug 18 2010

Keywords

Comments

Computation: Allan C. Wechsler for n <= 5 (manual), Fred Lunnon for n <= 8 (Maple), Michael Kleber for n <= 30 (Mathematica).

Examples

			For n = 5 there are a(5) = 189 words, permutations on the alphabet {1,2,3} of the 32 words
11111, 11112, 11121, 11123, 11211, 11212, 11213, 11231, 12111, 12112, 12113, 12121, 12122, 12123, 12131, 12132, 12212, 12213, 12221, 12222, 12223, 12231, 12232, 12311, 12312, 12313, 12321, 12322, 12323, 12331, 12332, 12333.
		

Crossrefs

See A005598 for 2 symbols, A180239 for 4 symbols.

Programs

  • Mathematica
    (* Number of ways to interleave N elements from 3 arithmetic seqs *)
    (* Program due to Michael Kleber, Aug 2010 *)
    (* Given a string like "ABCABA", produce a set of inequalities *)
    (* about the three arithmetic progressions giving successive A/B/Cs *)
    (* The N-th occurrence (1-indexed) of character X corresponds to the value *)
    (* BASE[X] + N * DELTA[X] *)
    (* In all functions, seq is eg {"A", "B", "C", "A", "B", "A"} *)
    (* The arithmetic-progression value of the i-th element of seq *)
    value[seq_, i_] := BASE[seq[[i]]] + DELTA[seq[[i]]] * numoccur[seq,i]
    numoccur[seq_, i_] := Count[Take[seq,If[i>0,i,Length[seq]+i+1]],seq[[i]]]
    (* First element of the seq is greater than anything that would precede it*)
    lowerbound[seq_] := (BASE[ # ] < value[seq,1])& /@ Union[seq]
    (* Each element of the seq is greater than the previous one *)
    upperbound[seq_] := (value[seq,-1] < value[Append[seq,# ],-1])& /@ Union[seq]
    (* Last element of the seq is less than anything that would follow it *)
    ordering[seq_] := Table[value[seq,i] < value[seq,i+1], {i,Length[seq]-1}]
    ineqs[seq_] := Join[ lowerbound[seq], ordering[seq], upperbound[seq] ]
    vars[seq_] := Join @@ ({BASE[ # ],DELTA[ # ]}& /@ Union[seq])
    witness[seq_] := FindInstance[ ineqs[seq], vars[seq] ]
    witness[s_String] := witness[Characters[s]]
    (* All obtainable length-n shuffles of three arithmetic seqs: *)
    names = {"A", "B", "C"}
    shuf[0] := {""}
    candidates[n_] := Flatten[Table[ob<>ch, {ob,shuf[n-1]}, {ch, names}]]
    shuf[n_] := shuf[n] = Select[ candidates[n], witness[ # ] != {}& ]
    (* Typical session *)
    In[18]:= Table[Length[shuf[i]],{i,0,12}]
    Out[18]= {1, 3, 9, 27, 75, 189, 447, 951, 1911, 3621, 6513, 11103, 18267}
    In[19]:= TimeUsed[]/60 Out[19]= 6.73642

Formula

Computation may be expedited by generating only words in which the symbols occur in increasing alphabetic order: this was done in the production version.

A180437 a(n) counts the distinct cubical (on alphabet of 3 symbols) billiard words with length n, acting as prefix to just k = 1 such word of length n+1 (that is, not "special").

Original entry on oeis.org

0, 0, 0, 6, 24, 78, 186, 372, 876, 1632, 3024, 5310, 8496, 13344, 21186, 31878, 46752, 66936, 94800, 130194
Offset: 0

Views

Author

Fred Lunnon, Sep 05 2010

Keywords

Comments

By symmetry under reversal, a(n) also counts length n cubical billiard words acting as suffix to just k length n+1 cubical billiard words. The attached program counts k-special words for k = 1,...,m, where m = 3 denotes the size of the alphabet.

Crossrefs

Programs

  • Magma
    // See Links.

A180438 a(n) counts the distinct cubical (on alphabet of 3 symbols) billiard words with length n, acting as prefix to just k = 2 such words of length n+1 (that is, a subset of "special").

Original entry on oeis.org

0, 0, 6, 18, 36, 78, 150, 306, 420, 792, 1338, 2082, 3228, 4830, 7050, 9954, 13920, 18738, 24666, 32610
Offset: 0

Views

Author

Fred Lunnon, Sep 05 2010

Keywords

Comments

By symmetry under reversal, a(n) also counts length n cubical billiard words acting as suffix to just k length n+1 cubical billiard words. Computation: Fred Lunnon for 0 <= n <= 19 (Magma). The program in A180437 counts k-special words for k = 1, ..., m, where m = 3 denotes the size of the alphabet.

Crossrefs

A180439 a(n) counts the distinct cubical (on alphabet of 3 symbols) billiard words with length n, acting as prefix to just k = 3 such words of length n+1 (that is, a subset of "special").

Original entry on oeis.org

1, 3, 3, 3, 9, 15, 33, 63, 153, 219, 261, 351, 585, 879, 933, 1233, 1401, 1899, 2301, 3111
Offset: 0

Views

Author

Fred Lunnon, Sep 05 2010

Keywords

Comments

By symmetry under reversal, a(n) also counts length n cubical billiard words acting as suffix to just k length n+1 cubical billiard words. Computation: Fred Lunnon for 0 <= n <= 19 (Magma). The program in A180437 counts k-special words for k = 1,...,m, where m = 3 denotes the size of the alphabet.

Crossrefs

Showing 1-4 of 4 results.