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 21-22 of 22 results.

A369924 Number of uniform words of length n with adjacent elements unequal using an infinite alphabet up to permutations of the alphabet.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 7, 1, 38, 30, 331, 1, 5560, 1, 47846, 164585, 815693, 1, 35149698, 1, 338596631, 4420377702, 4939227217, 1, 1430570927009, 66218360626, 2850860253242, 372419004321831, 628358300200811, 1, 156433852692766134, 1, 2606291948338277064
Offset: 0

Views

Author

Andrew Howroyd, Feb 06 2024

Keywords

Comments

A word is uniform here if each symbol that occurs in the word occurs with the same frequency.
a(n) is the number of ways to partition [n] into parts of equal size and no part containing values that differ by 1.

Examples

			The a(4) = 2 words are abab, abcd.
The a(6) = 7 words are ababab, abacbc, abcabc, abcacb, abcbac, abcbca, abcdef.
The a(4) = 2 set partitions are {{1,3}, {2,4}} and {{1},{2},{3},{4}}.
		

Crossrefs

The case for adjacent elements possibly equal is A038041.
Cf. A322013, A369925 (circular words).

Programs

  • PARI
    \\ Needs T(n,k) from A322013.
    a(n) = {if(n==0, 1, sumdiv(n, d, T(d, n/d)))}

Formula

a(n) = Sum_{d|n} A322013(d, n/d) for n > 0.
a(p) = 1 for prime p.

A377586 Numbers of directed Hamiltonian paths in the complete 4-partite graph K_{n,n,n,n}.

Original entry on oeis.org

24, 13824, 53529984, 751480602624, 27917203599360000, 2267561150913576960000, 354252505303682314076160000, 97087054992658680467800719360000, 43551509948777170973522371396239360000, 30293653795894300342540281328749772800000000
Offset: 1

Views

Author

Zlatko Damijanic, Nov 02 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n!^4 * SeriesCoefficient[1/(1 - Sum[x[i]/(1 + x[i]), {i, 1, 4}]), Sequence @@ Table[{x[i], 0, n}, {i, 1, 4}]], {n, 1, 10}]
  • Python
    from math import factorial as fact, comb
    from itertools import combinations_with_replacement
    def a(n):
        #  Using modified formula for counting sequences found in Eifler et al.
        result = 0
        fn = fact(n)
        for i, j, k in combinations_with_replacement(range(1, n+1), 3):
            patterns = [(3,0,0)] if i == j == k else \
              [(2,0,1)] if i == j != k else \
              [(1,2,0)] if i != j == k else [(1,1,1)]
            for a, b, c in patterns:
                s = a*i + b*j + c*k
                num = fact(3)
                den = fact(a) * fact(b) * fact(c)
                if a:
                    for _ in range(a): num, den = num * comb(n-1, i-1), den * fact(i)
                if b:
                    for _ in range(b): num, den = num * comb(n-1, j-1), den * fact(j)
                if c:
                    for _ in range(c): num, den = num * comb(n-1, k-1), den * fact(k)
                num *= comb(s + 1, n) * fact(s)
                result += (1 if (3*n - s) % 2 == 0 else -1) * (num // den)
        for _ in range(4): result *= fn
        return result
    print([a(n) for n in range(1,11)]) # Zlatko Damijanic, Nov 18 2024

Formula

a(n) = 24 * n!^4 * A190918(n).
a(n) = n!^4 * A322093(n,4).
Previous Showing 21-22 of 22 results.