Skip to content

Instantly share code, notes, and snippets.

@cpdean
Created July 21, 2012 16:25
Show Gist options
  • Save cpdean/3156320 to your computer and use it in GitHub Desktop.
Save cpdean/3156320 to your computer and use it in GitHub Desktop.
Trolling with phone math
sleuth = 7+1+5
target = 37
simple_sum = target - sleuth # 24
from itertools import combinations
seed = [2 for n in range(7)] + [3 for n in range(7)] + [5 for n in range(7)]
answers = set(a for a in combinations(seed,7) if sum(a) == simple_sum)
# yields 2223555 and 2333355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment