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.
%I A334246 #10 Apr 29 2020 20:43:36 %S A334246 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, %T A334246 520,675,851,1068,1329,1640,2001,2460,2989,3615,4342,5202,6204,7381, %U A334246 8697,10256,12042,14069,16435,19090,22141,25607,29534 %N 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)|. %C A334246 _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. %C A334246 Last night I sat behind two wizards on a bus and overheard the following: %C A334246 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. %C A334246 Red Wizard: How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages? %C A334246 Blue Wizard: No, you could not. %C A334246 Red Wizard: Aha! At last, I know how old you are! %C A334246 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? %C A334246 This problem posed by Conway looks at different multisets that correspond to the same ordered triple, which motivated the study of this sequence. %C A334246 The number n for which a(n)=1 gives the solution to Conway's puzzle. %H A334246 Jay Bennett, <a href="https://www.popularmechanics.com/science/math/a27415/riddle-of-the-week-34-two-wizards-ride-a-bus/">Riddle of the week #34: Two wizards ride a bus</a>, Popular Mechanics. Hearst Communications, Inc., 4 Aug. 2017. 12 Jun. 2018 Accessed. %H A334246 John B. Kelly, <a href="http://dx.doi.org/10.1090/S0002-9939-1964-0168542-2">Partitions with equal products</a>, Proc. Amer. Math. Soc. 15 (1964), 987-990. %H A334246 Tanya Khovanova, <a href="http://arxiv.org/abs/1210.5460">Conway's Wizards</a>, arXiv:1210.5460 [math.HO], 2012. %e A334246 For n=12: {(4, 48)}. %e A334246 For n=13: {(3, 36), (5, 48)}. %e A334246 For n=14: {(4, 36), (3, 40), (3, 72), (5, 96), (6, 48)}. %e A334246 For n=15: {(5, 36), (5, 144), (4, 72), (4, 40), (6, 96), (7, 48), (4, 96)}. %o A334246 (Python) %o A334246 from collections import Counter %o A334246 from functools import reduce %o A334246 def partitions(n, I=1): %o A334246 yield (n,) %o A334246 for i in range(I, n//2 + 1): %o A334246 for p in partitions(n-i, i): %o A334246 yield (i,) + p %o A334246 def p(i): #ret partitions of i, sorted by part number and product of parts %o A334246 return sorted( %o A334246 [ %o A334246 ( %o A334246 len(p), %o A334246 reduce( %o A334246 (lambda x, y: x * y), p) %o A334246 ) %o A334246 for p in partitions(i) %o A334246 ] %o A334246 ) %o A334246 def a(p_list): #returns number of pairs appearing more than once %o A334246 return len([x for x,y in Counter(p_list).most_common() if y > 1]) %o A334246 print(a(p(i))) # Will print the value of a(i) %Y A334246 If only counting unique k: A316945; if only counting unique p: A316946. %Y A334246 See A140437 for another sequence related to the wizards problem. %K A334246 nonn %O A334246 1,13 %A A334246 _Bryan Bischof_, Apr 20 2020