All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Penny Piles (Posted on 2008-04-09) Difficulty: 3 of 5
Susan gave her nephew a number of pennies, as well as a mathematical challenge: to figure out how many ways there were of dividing the pennies into three piles. The pennies are indistinguishable, so the identity of the pennies doesn't matter, nor does the order of the piles. For example, if there had been nine pennies, the piles could have been arranged in any of seven ways: 1+1+7, 1+2+6, 1+3+5, 1+4+4, 2+2+5, 2+3+4, 3+3+3.

There were actually more pennies than this, and in fact, the number of ways was a four-digit number.

However, the nephew misunderstood the instructions. He thought that no two of the piles could be equal, and so came up with a smaller number. For example, if the number of pennies were nine, as above, only three of the arrangements into piles consisted of unique sizes: 1+2+6, 1+3+5, 2+3+4, and the nephew would have reported that, incorrectly.

As mentioned the actual number of ways was a four-digit number. The number reported by the nephew was also a four-digit number, and as a result of his misunderstanding, the only difference between his reported number and Susan's expected answer was that the middle two digits were reversed.

How many pennies did Susan give to her nephew?

  Submitted by Charlie    
Rating: 3.0000 (2 votes)
Solution: (Hide)
With 182 pennies, the number of ways they could be put into piles would be 2760. The number of ways that would not involve duplicate-sized piles would be 2670.

So the number of pennies was 182.

By the way, though the program below uses loops to find each way of distributing the pennies, the formula n^2/12, rounded to the nearest integer, works for the total number of ways, and (n-3)^2 / 12, again rounded, gives the number of ways with no duplicate-sized piles. See Sloane No. A001399.

CLS
FOR n = 1 TO 2000
  ct = 0: ct2 = 0
  FOR a = 1 TO n / 3
  FOR b = a TO (n - a) / 2
    c = n - a - b
    ct = ct + 1
    IF c > b AND b > a THEN ct2 = ct2 + 1
  NEXT
  NEXT
  IF ct > 999 AND ct < 10000 AND ct2 > 999 AND ct2 < 10000 THEN
   d11 = ct \ 1000
   d12 = (ct \ 100) MOD 10
   d13 = (ct \ 10) MOD 10
   d14 = ct MOD 10
   d21 = ct2 \ 1000
   d22 = (ct2 \ 100) MOD 10
   d23 = (ct2 \ 10) MOD 10
   d24 = ct2 MOD 10
   IF d11 = d21 AND d14 = d24 AND d12 = d23 AND d13 = d22 THEN
    PRINT n, ct, ct2, INT((n) ^ 2 / 12 + .5)
   END IF
  END IF
  IF ct > 9999 THEN EXIT FOR
NEXT

Based on Enigma No. 1482, "Piling on the agony", by Susan Denham, New Scientist, 23 February 2008.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
AnswerK Sengupta2008-12-31 00:23:09
re: Note on posted solutionbrianjn2008-04-13 23:44:43
Note on posted solutionCharlie2008-04-13 12:21:41
SolutionOn my wayFrankM2008-04-10 21:36:40
re:partitionsAdy TZIDON2008-04-10 18:34:20
numerical solution with little to no explanationJohn Reid2008-04-09 21:18:03
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (16)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information