- 13 Oct '11 09:03An apprentice witch will work for a year and a day, that is, a total of 366 days. Young Rowena gets such a job, and it is paid a daily wage that is some small sum, less than one galleon per day, in addition to room and board.

At the end of the apprenticeship, Rowena takes all the coins to the Gringotts bank and gets told she now has a pile of galleons, 11 sickles, and 11 knuts.

How big is the pile of galleons?

(17 sickles make one galleon, and 29 knuts make one sickle) - 13 Oct '11 10:45You're correct. I've found two ways to get to the answer.. the brute-force method of checking all 493 possibilities one by one.. or the somewhat prettier one. I'm a teacher and like to add problems like these to the end of exams for those who finish early. Over the years I've both gathered and come up with quite a few.
- 13 Oct '11 12:38*smiles* Glad you enjoy.

The second way I had in mind was to solve first the knuts..

366k mod 29 = 11 and from that find how many knuts the wage was, and how many sickles they make after Gringott's is ready with the pile of loose change; then add repeat the process for sickles, (366s + sickles from knuts) most 17 = 11, getting the day wage. I think this was inspired by public-key cryptography, which encodes stuff in a way that has some similarities. Given the wage, it is easy to find out how many knuts and sickles are left after the rest is galleons - but doing it the other way is a lot harder. - 14 Oct '11 07:03Ah - I used a combination of both methods. I brute forced it using the knut currency (given that was the smallest denominator) on the basis 493 knuts = 1 galleon. I figured the payrate was 405 knuts per day. I kept going until the days * payrate less what was on hand (being 330 knuts) was a multiple of 493.

Interesting you mention cryptography - I have done some (hobby) work in this area. Particularly codifying a method similar to a one-time-pad and steganography using combinations of apparently random environmental variables as the initial seed. I also developed code for cracking open numbers that are the product of two prime numbers - using a combination of brute force and logic. But much like any other code cracker, computer processing power is my constraint. From memory I could crack a 20 digit number in less than 2 minutes using a desktop PC about 5 years ago......but I see there are ways around CPU limitations nowadays which should make the job easier. Time permitting I will get back into it...it has been a hobby for some years but life gets in the way of such pursuits. Hence the enjoyment of the math / logic puzzles.