Michael Reid’s Happy New Year Puzzle
Here is another puzzle from Michael Reid on NOBNET. (Michael also notes that if you find a solution (a,b,c,d,e,f) then (d,e,f,a,b,c) is another solution.)
Puzzle: Replace a, b, c, d, e, f with the first six prime numbers, in some order, to make the expression a * b^c + d * e^f equal to the New Year.
Best wishes for a happy, healthy and prosperous New Year!
1 Comment »
Leave a Reply
-
Archives
- April 2012 (3)
- February 2012 (3)
- January 2012 (3)
- November 2011 (1)
- August 2011 (1)
- July 2011 (1)
- June 2011 (1)
- May 2011 (1)
- April 2011 (1)
- August 2010 (1)
- March 2010 (2)
- February 2010 (4)
-
Categories
-
RSS
Entries RSS
Comments RSS
Thanks for posting!
***SPOILERS***
Found the two solutions by brute force in Sage:
primes = primes_first_n(6)
func(a, b, c, d, e, f) = a * b^c + d * e^f
for a in permutations(primes):
….: if func(*a) == 2012:
….: print a
….:
[11, 5, 3, 13, 7, 2]
[13, 7, 2, 11, 5, 3]
Or a two-liner:
func(a, b, c, d, e, f) = a * b^c + d * e^f
[a for a in permutations(primes_first_n(6)) if func(*a) == 2012]