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.

A273013 Number of different arrangements of nonnegative integers on a pair of n-sided dice such that the dice can add to any integer from 0 to n^2-1.

Original entry on oeis.org

1, 1, 1, 3, 1, 7, 1, 10, 3, 7, 1, 42, 1, 7, 7, 35, 1, 42, 1, 42, 7, 7, 1, 230, 3, 7, 10, 42, 1, 115, 1, 126, 7, 7, 7, 393, 1, 7, 7, 230, 1, 115, 1, 42, 42, 7, 1, 1190, 3, 42, 7, 42, 1, 230, 7, 230, 7, 7, 1, 1158, 1, 7, 42, 462, 7, 115, 1, 42, 7, 115, 1, 3030
Offset: 1

Views

Author

Elliott Line, May 13 2016

Keywords

Comments

The set of b values (see formula), and therefore also a(n), depends only on the prime signature of n. So, for example, a(24) will be identical to a(n) of any other n which is also of the form p_1^3*p_2, (e.g., 40, 54, 56).
The value of b_1 will always be 1. When n is prime, the only nonzero b will be b_1, so therefore a(n) will be 1.
In any arrangement, both dice will have a 0, and one will have a 1 (here called the lead die). To determine any one of the actual arrangements to numbers on the dice, select one of the permutations of divisors (for the lead die), then select another permutation that is either the same length as that of the lead die, or one less. For example, if n = 12, we might select 2*3*2 for the lead die, and 3*4 for the second die. These numbers effectively tell you when to "switch track" when numbering the dice, and will uniquely result in the numbering: (0,1,6,7,12,13,72,73,78,79,84,85; 0,2,4,18,20,22,36,38,40,54,56,58).
a(n) is the number of (unordered) pairs of polynomials c(x) = x^c_1 + x^c_2 + ... + x^c_n, d(x) = x^d_1 + x^d_2 + ... + x^d_n with nonnegative integer exponents such that c(x)*d(x) = (x^(n^2)-1)/(x-1). - Alois P. Heinz, May 13 2016
a(n) is also the number of principal reversible squares of order n. - S. Harry White, May 19 2018
From Gus Wiseman, Oct 29 2021: (Start)
Also the number of ordered factorizations of n^2 with alternating product 1. This follows from the author's formula. Taking n instead of n^2 gives a(sqrt(n)) if n is a perfect square, otherwise 0. Here, an ordered factorization of n is a sequence of positive integers > 1 with product n, and the alternating product of a sequence (y_1,...,y_k) is Product_i y_i^((-1)^(i-1)). For example, the a(1) = 1 through a(9) = 3 factorizations are:
() (22) (33) (44) (55) (66) (77) (88) (99)
(242) (263) (284) (393)
(2222) (362) (482) (3333)
(2233) (2244)
(2332) (2442)
(3223) (4224)
(3322) (4422)
(22242)
(24222)
(222222)
The even-length case is A347464.
(End)

Examples

			When n = 4, a(n) = 3; the three arrangements are (0,1,2,3; 0,4,8,12), (0,1,4,5; 0,2,8,10), (0,1,8,9; 0,2,4,6).
When n = 5, a(n) = 1; the sole arrangement is (0,1,2,3,4; 0,5,10,15,20).
		

Crossrefs

Positions of 1's are 1 and A000040.
A000290 lists squares, complement A000037.
A001055 counts factorizations, ordered A074206.
A119620 counts partitions with alternating product 1, ranked by A028982.
A339846 counts even-length factorizations, ordered A174725.
A339890 counts odd-length factorizations, ordered A174726.
A347438 counts factorizations with alternating product 1.
A347460 counts possible alternating products of factorizations.
A347463 counts ordered factorizations with integer alternating product.
A347466 counts factorizations of n^2.

Programs

  • Mathematica
    facs[n_] := If[n <= 1, {{}}, Join@@Table[Map[Prepend[#, d]&, Select[facs[n/d], Min@@# >= d&]], {d, Rest[Divisors[n]]}]];
    altprod[q_] := Product[q[[i]]^(-1)^(i-1), {i, Length[q]}];
    Table[Length[Select[Join@@Permutations/@facs[n^2], altprod[#] == 1&]],{n, 30}]
    (* Gus Wiseman, Oct 29 2021 *)
    (* or *)
    ofc[n_,k_] := If[k > PrimeOmega[n], 0, If[k == 0 && n == 1, 1, Sum[ofc[n/d, k-1],{d, Rest[Divisors[n]]}]]];
    Table[If[n == 1, 1, Sum[ofc[n, x]^2 + ofc[n, x]*ofc[n, x+1], {x, n}]],{n, 30}]
    (* Gus Wiseman, Oct 29 2021, based on author's formula *)
  • PARI
    A273013aux(n, k=0, t=1) = if(1==n, (1==t), my(s=0); fordiv(n, d, if((d>1), s += A273013aux(n/d, 1-k, t*(d^((-1)^k))))); (s));
    A273013(n) = A273013aux(n^2); \\ Antti Karttunen, Oct 30 2021
    
  • SageMath
    @cached_function
    def r(m,n):
        if n==1:
            return(1)
        divList = divisors(m)[:-1]
        return(sum(r(n,d) for d in divList))
    def A273013(n):
        return(r(n,n)) # William P. Orrick, Feb 19 2023

Formula

a(n) = b_1^2 + b_2^2 + b_3^2 + ... + b_1*b_2 + b_2*b_3 + b_3*b_4 + ..., where b_k is the number of different permutations of k divisors of n to achieve a product of n. For example, for n=24, b_3 = 9 (6 permutations of 2*3*4 and 3 permutations of 2*2*6).
a(n) = r(n,n) where r(m,1) = 1 and r(m,n) = Sum_{d|m,dWilliam P. Orrick, Feb 19 2023

A360439 Square array read by antidiagonals upwards: T(n,k), n>=0, k>=0, is the number of ways of choosing nonnegative numbers for k indistinguishable (p^n*q)-sided dice so that it is possible to roll every number from 0 to (p^n*q)^k-1, where p and q are distinct primes.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 42, 71, 1, 1, 1, 230, 3660, 1001, 1, 1, 1, 1190, 160440, 614040, 18089, 1, 1, 1, 5922, 6387150, 299145000, 169200360, 398959, 1, 1, 1, 28644, 238504266, 127534407000, 1175153779800, 69444920160, 10391023, 1
Offset: 0

Views

Author

William P. Orrick, Feb 18 2023

Keywords

Comments

Also the number of Krasner factorizations of (x^((p^n*q)^k)-1) / (x-1) into k polynomials each having p^n*q nonzero terms all with coefficient +1. (Krasner and Ranulac, 1937)

Examples

			For two ten-sided dice we have k = 2 and n = 1 since 10 = 2^1*5. The seven configurations are
  {{0,1,2,3,4,5,6,7,8,9}, {0,10,20,30,40,50,60,70,80,90}},
  {{0,1,2,3,4,50,51,52,53,54}, {0,5,10,15,20,25,30,35,40,45}},
  {{0,1,2,3,4,25,26,27,28,29}, {0,5,10,15,20,50,55,60,65,70}},
  {{0,1,10,11,20,21,30,31,40,41}, {0,2,4,6,8,50,52,54,56,58}},
  {{0,1,20,21,40,41,60,61,80,81}, {0,2,4,6,8,10,12,14,16,18}},
  {{0,1,2,3,4,10,11,12,13,14}, {0,5,20,25,40,45,60,65,80,85}},
  {{0,1,4,5,8,9,12,13,16,17}, {0,2,20,22,40,42,60,62,80,82}}.
Array begins:
  1  1      1           1                  1                         1  ...
  1  1      7          71               1001                     18089  ...
  1  1     42        3660             614040                 169200360  ...
  1  1    230      160440          299145000             1175153779800  ...
  1  1   1190     6387150       127534407000          6888547183518000  ...
  1  1   5922   238504266     49829456981304      36179571823974699120  ...
  1  1  28644  8507955456  18306027156441024  175934152220744900062080  ...
  ...
		

Crossrefs

For a table with the number of sides not restricted to the form p^n*q see A360098.
T(n,2) = A349427(n+1).
T(1,k) = |A002119(k)|.

Programs

  • SageMath
    def T(n,k):
        return(factorial(k*n)/factorial(n)^k/factorial(k)\
         * sum((-n)^(k-j)*binomial(n*k+j,j)*falling_factorial(k,j)\
         for j in range(k+1)))

Formula

T(n,k) = (n*k)!/((n!)^k*k!) * Sum_{j=0}^k (-n)^(k-j)*binomial(n*k+j,j)*k!/(k-j)!.
T(n,k) = A060540(k,n) * Sum_{j=0}^k (-n)^(k-j)*binomial(n*k+j,j)*k!/(k-j)! for n>=1, k>=1.

A360440 Square array read by antidiagonals upwards: T(n,k), n>=0, k>=0, is the number of ways of choosing nonnegative numbers for k indistinguishable A063008(n)-sided dice so that it is possible to roll every number from 0 to (A063008(n))^k-1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 7, 15, 1, 1, 1, 1, 10, 71, 105, 1, 1, 1, 1, 42, 280, 1001, 945, 1, 1, 1, 1, 115, 3660, 15400, 18089, 10395, 1, 1, 1, 1, 35, 20365, 614040, 1401400, 398959, 135135, 1, 1
Offset: 0

Views

Author

William P. Orrick, Feb 19 2023

Keywords

Comments

The number of configurations depends on the number of sides on the dice only through its prime signature. A063008 provides a canonical representative of each prime signature.
Also the number of Krasner factorizations of (x^(A063008(n))^k)-1) / (x-1) into k polynomials each having A063008(n) nonzero terms all with coefficient +1. (Krasner and Ranulac, 1937)

Examples

			A063008(2) = 4. There are 3 ways to assign numbers to two 4-sided dice:
 {{0, 1, 2, 3}, {0, 4, 8, 12}},
 {{0, 1, 8, 9}, {0, 2, 4,  6}},
 {{0, 1, 4, 5}, {0, 2, 8, 10}}.
The table begins:
  1  1    1       1          1              1                 1  ...
  1  1    1       1          1              1                 1  ...
  1  1    3      15        105            945             10395  ...
  1  1    7      71       1001          18089            398959  ...
  1  1   10     280      15400        1401400         190590400  ...
  1  1   42    3660     614040      169200360       69444920160  ...
  1  1  115   20365    6891361     3815893741     3141782433931  ...
  1  1   35    5775    2627625     2546168625     4509264634875  ...
  1  1  230  160440  299145000  1175153779800  8396156461492800  ...
  ...
The rows shown enumerate configurations for dice of 1, 2, 4, 6, 8, 12, 30, 16, and 24 sides, which represent the prime signatures {}, {1}, {2}, {1,1}, {3}, {2,1}, {1,1,1}, {4}, and {3,1}.
		

Crossrefs

The concatenation of all prime signatures, listed in the order that corresponds to the rows of T(n,k), is A080577.
T(3,k) is |A002119(k)|. Starting with k = 1, T(1,k), T(2,k), T(4,k), and T(7,k) are given by columns 1-4 of A060540.
Row n is row A063008(n) of A360098.

Programs

  • SageMath
    @cached_function
    def r(i,M):
        kminus1 = len(M)
        u = tuple([1 for j in range(kminus1)])
        if i > 1 and M == u:
            return(1)
        elif M != u:
            divList = divisors(i)[:-1]
            return(sum(r(M[j],tuple(sorted(M[:j]+tuple([d])+M[j+1:])))\
             for d in divList for j in range(kminus1)))
    def f(n,k):
        if n == 1 or k == 0:
            return(1)
        else:
            return(r(n,tuple([n for j in range(k-1)]))) / factorial(k-1)
    # The following function produces the top left corner of the table:
    def TArray(maxn,maxk):
        retArray = []
        primesList = []
        ptnSum = 0
        ptnItr = Partitions(ptnSum)
        ptn = ptnItr.first()
        n = 0
        while n <= maxn:
            if ptn == None:
                primesList.append(Primes()[ptnSum])
                ptnSum = ptnSum + 1
                ptnItr = Partitions(ptnSum)
                ptn = ptnItr.first()
            prdct = prod(primesList[j]^ptn[j] for j in range(len(ptn)))
            retArray.append([f(prdct,k) for k in range(maxk+1)])
            n = n + 1
            ptn = ptnItr.next(ptn)
        return(retArray)

Formula

T(n,k) = f(A063008(n),k), where f(n,k) is the table given by A360098.
Showing 1-3 of 3 results.