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.

A316946 A triple of positive integers (n,p,k) is admissible if there exist at least two different multisets of k positive integers, {x_1,x_2,...,x_k} and {y_1,y_2,...,y_k}, such that x_1+x_2+...+x_k = y_1+y_2+...+y_k = n and x_1x_2...x_k = y_1y_2...y_k = p. For each n, let A(n) = {p:(n,p,k) is admissible for some k}, and let a(n) = |A(n)|.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 6, 10, 14, 19, 26, 33, 43, 54, 68, 87, 106, 129, 157, 187, 226, 269, 319, 378, 445, 521, 610, 712, 825, 952, 1099, 1261, 1443, 1655, 1889, 2148, 2440, 2769, 3135, 3542, 4000, 4494, 5049, 5661, 6346, 7099, 7938, 8857, 9862, 10972, 12190, 13532, 15000, 16611, 18366
Offset: 1

Views

Author

Keywords

Comments

John Conway proposed an interesting math puzzle in the 1960s, which is now generally known as the "Conway's wizard problem." Here is the problem.
Last night I sat behind two wizards on a bus and overheard the following:
Blue Wizard: I have a positive integer number of children, whose ages are positive integers. The sum of their ages is the number of this bus, while the product is my own age.
Red Wizard: How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?
Blue Wizard: No, you could not.
Red Wizard: Aha! At last, I know how old you are!
Apparently the Red Wizard had been trying to determine the Blue Wizard's age for some time. Now, what was the number of the bus?
This problem posed by Conway looks at different multisets that correspond to the same ordered triple, which motivated the study of this sequence.

Examples

			a(15) = 6 since A(15) = {36,40,48,72,96,144}:
p = 36 [9, 2, 2, 1, 1], [6, 6, 1, 1, 1]
p = 40 [10, 2, 2, 1], [8, 5, 1, 1]
p = 48 [6, 2, 2, 2, 1, 1, 1], [4, 4, 3, 1, 1, 1, 1]
p = 72 [9, 2, 2, 2], [8, 3, 3, 1], [6, 6, 2, 1],
p = 96 [8, 3, 2, 2], [6, 4, 4, 1], [6, 2, 2, 2, 2, 1], [4, 4, 3, 2, 1, 1]
p = 144 [6, 3, 2, 2, 2], [4, 4, 3, 3, 1].
		

Crossrefs

Programs

  • Mathematica
    Do[repeats = {};  Do[intpart = IntegerPartitions[sum, {n}];   prod = Tally[Table[Times @@ intpart[[i]], {i, Length[intpart]}]];   repeatprod = Select[prod, #[[2]] > 1 &];   If[repeatprod != {},    repeats = Join[repeats, Transpose[repeatprod][[1]]]], {n, 3,    sum - 8}]; output = DeleteDuplicates[repeats];  Print[sum, " ", Length[output]], {sum, 12, 100}]

A317254 a(n) is the smallest integer such that for all s >= a(n), there are at least n-1 different partitions of s into n parts, namely {x_{11},x_{12},...,x_{1n}}, {x_{21},x_{22},...,x_{2n}},..., and {x_{n-1,1},x_{n-1,2},...,x_{n-1,n}}, such that the products of every set are equal.

Original entry on oeis.org

19, 23, 23, 26, 27, 29, 31, 32, 35, 36, 38, 40, 42, 44, 45, 47, 49, 50, 52, 53, 54, 55, 57, 58, 59, 61, 62, 63, 64, 66, 67, 69, 70, 71, 73, 74, 75, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 99, 100, 101
Offset: 3

Views

Author

Keywords

Examples

			a(3)=19. From s=19 onward, there are at least 2 different partitions of s into 3 parts with equal products:
s=19: {12,4,3} & {9,8,2}:
  12 + 4 + 3 = 9 + 8 + 2 =  19;
  12 * 4 * 3 = 9 * 8 * 2 = 144;
s=20: {15,3,2} & {10,9,1}:
  15 + 3 + 2 = 10 + 9 + 1 = 20;
  15 * 3 * 2 = 10 * 9 * 1 = 90;
s=21: {16,3,2} & {12,8,1}:
  16 + 3 + 2 = 12 + 8 + 1 = 21;
  16 * 3 * 2 = 12 * 8 * 1 = 96.
		

Crossrefs

Programs

  • Mathematica
    Do[maxsumnotwork = 0;  Do[intpart = IntegerPartitions[sum, {n}];   prod = Table[Times @@ intpart[[i]], {i, Length[intpart]}];   prodtally = Tally[prod];   repeatprod = Select[prodtally, #[[2]] >= n - 1 &];   If[repeatprod == {}, maxsumnotwork = sum], {sum, 12, 200}];  Print[n, " ", maxsumnotwork + 1], {n, 3, 60}]

A334246 A triple of positive integers (n,p,k) is admissible if there exist at least two different multisets of k positive integers, {x_1,x_2,...,x_k} and {y_1,y_2,...,y_k}, such that x_1+x_2+...+x_k = y_1+y_2+...+y_k = n and x_1x_2...x_k = y_1y_2...y_k = p. For each n, let A(n) = {(p,k):(n,p,k) is admissible for some k}; then a(n) = |A(n)|.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 7, 13, 20, 29, 44, 66, 90, 129, 174, 232, 306, 406, 520, 675, 851, 1068, 1329, 1640, 2001, 2460, 2989, 3615, 4342, 5202, 6204, 7381, 8697, 10256, 12042, 14069, 16435, 19090, 22141, 25607, 29534
Offset: 1

Views

Author

Bryan Bischof, Apr 20 2020

Keywords

Comments

J. H. Conway proposed an interesting math puzzle in the 1960s, which is now generally known as "Conway's wizard problem." Here is the problem.
Last night I sat behind two wizards on a bus and overheard the following:
Blue Wizard: I have a positive integer number of children, whose ages are positive integers. The sum of their ages is the number of this bus, while the product is my own age.
Red Wizard: How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?
Blue Wizard: No, you could not.
Red Wizard: Aha! At last, I know how old you are!
Apparently the Red Wizard had been trying to determine the Blue Wizard's age for some time. Now, what was the number of the bus?
This problem posed by Conway looks at different multisets that correspond to the same ordered triple, which motivated the study of this sequence.
The number n for which a(n)=1 gives the solution to Conway's puzzle.

Examples

			For n=12: {(4, 48)}.
For n=13: {(3, 36), (5, 48)}.
For n=14: {(4, 36), (3, 40), (3, 72), (5, 96), (6, 48)}.
For n=15: {(5, 36), (5, 144), (4, 72), (4, 40), (6, 96), (7, 48), (4, 96)}.
		

Crossrefs

If only counting unique k: A316945; if only counting unique p: A316946.
See A140437 for another sequence related to the wizards problem.

Programs

  • Python
    from collections import Counter
    from functools import reduce
    def partitions(n, I=1):
        yield (n,)
        for i in range(I, n//2 + 1):
            for p in partitions(n-i, i):
                yield (i,) + p
    def p(i): #ret partitions of i, sorted by part number and product of parts
        return sorted(
            [
                (
                    len(p),
                    reduce(
                        (lambda x, y: x * y), p)
                )
                for p in partitions(i)
            ]
        )
    def a(p_list): #returns number of pairs appearing more than once
        return len([x for x,y in Counter(p_list).most_common() if y > 1])
    print(a(p(i))) # Will print the value of a(i)
Showing 1-3 of 3 results.