Saturday, October 8, 2022
HomePuzzlesarithmetic - Markus' fortunate numbers

# arithmetic – Markus’ fortunate numbers

I’d guess the reply is 130, primarily based on output from the next python program. There are 140008 methods to make the sum 130, and the tuple (5, 8, 11, 26, 37, 43) has sum 130, product 18201040, and 130 occasions 140008 is 18201040.

Here’s the python program, adopted by its output:

``````#!/usr/bin/env python
# Re: http://puzzling.stackexchange.com/questions/2119/markus-lucky-numbers
# Find: Six distinct numbers from [1,49] such that their sum, occasions
# the variety of attainable methods to get that sum, is the same as their
# product, which is >= 10,000,000.

from itertools import mixtures
from operator import mul

u = vary(1,50)
maxSum = 44+45+46+47+48+49
methods = [0]*(maxSum+1)
for c in mixtures(u, 6):
s = sum(c)
methods[s] += 1

for c in mixtures(u, 6):
s = sum(c)                  # Get sum of #'s
p = scale back(mul, c, 1)       # Get product of #'s
w = methods[s]                 # Get # of the way to make sum
if s*w == p:
print s, w, p, c
``````

It took 0m14.775s to run, and produced the next output:

``````36 110 3960 (1, 2, 3, 4, 11, 15)
45 532 23940 (1, 4, 5, 7, 9, 19)
76 13552 1029952 (2, 8, 11, 14, 19, 22)
130 140008 18201040 (5, 8, 11, 26, 37, 43)
``````

RELATED ARTICLES