OFFSET
1,13
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.
LINKS
Jay Bennett, Riddle of the week #34: Two wizards ride a bus, Popular Mechanics. Hearst Communications, Inc., 4 Aug. 2017. 12 Jun. 2018 Accessed.
John B. Kelly, Partitions with equal products, Proc. Amer. Math. Soc. 15 (1964), 987-990.
Tanya Khovanova, Conway's Wizards, arXiv:1210.5460 [math.HO], 2012.
EXAMPLE
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)}.
PROG
(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)
CROSSREFS
KEYWORD
nonn
AUTHOR
Bryan Bischof, Apr 20 2020
STATUS
approved