Fast Thinking

How much time will it take you to answer the following question?

Can the equation 29x + 30y + 31z = 366 be solved in natural numbers?



  1. Chris Tunstall:

    x + y + z = 12; z = x + 6; so 1, 4, 7 or 2, 2, 8. Took a couple of minutes (too long) owing to poor mental arithmetic!

  2. Oscar Cunningham:

    “29 and 30 are coprime so by setting z = 0 and using Bezout’s theorem we can see the answer is Yes.” took me about two seconds. It took me a minute or so to spot the “obvious” solution of x=1, y=4, z=7.

  3. Jess:

    I’m pretty sure I’ll be able to answer this next year.

  4. tanyakh:

    Jess, you made me laugh. You got it!

  5. JJ Rodríguez:

    Actually, more than I’d like to admit, because at first sight I misunderstood the question and thought that we were asked to solve the equation. Afterwards, just 30 seconds:
    30(x+y+z)-x+z=366=30·12+6, and then it goes as Chris wrote above.
    Nice question anyway

  6. Andrew:

    366 is close to 360, which is 12*30. So 6*30 + 6*31 would work, except you wanted natural numbers, so we need at least one 29. So let’s trade 2*30 for 1*29 + 1*31, giving 1*29 + 4*30 + 7*31 = 366.

  7. tanyakh:

    Jess got it. I am not sure anyone else got it.

  8. JJ Rodríguez:

    OK now. You’re so mean JFMAMJJASOND

  9. A puzzle for a leap year – The nth Root:

    […] Can the equation 29x + 30y + 31z = 366 be solved in natural numbers? (Tanya Khovanova’s Math Blog) […]

  10. Angelo Scordo:

    A couple of minutes, I’m not a fast thinker.
    I summed 29+30+31 = 90
    I made 366-90 = 276
    276/3 = 92 = x = y = z
    the solution is 121,122,123

  11. Angelo Scordo:

    Trying to do it quickly, I did the wrong calculations. However it was not necessary to make any calculation, it is the leap year months, we have only one February with 29 days, 4 months with 30 days and 7 months with 31 days.

  12. Darlyn Victoriano Bremont:

    Only using logical deductions:

    I first begin using algebraic manipulations to solve the problems,
    and the i notice, 29,30,31 and see that these guys are the number of days in the moths,
    so after that I see the Calendar to check the number of days of February in 2019, see 28 days, so the equation can’t be solve in the natural numbers.

  13. Hiren:

    Took me 15 seconds (additional 10 seconds to find how many months have 31 days by using the ‘knuckle’ method
    1 month with 29 days = 29
    4 months with 30 days. 30*4 = 120
    7 months with 31 days. 31*7 = 217
    Total = 366
    so (x,y,z) = (1,4,7)

  14. Angelo Scordo:

    There are other possible solutions for the equation 29x + 30y + 31z = 366.
    And well, yes. The other solution is (x,y,z) = (0,6,6)
    This solution was the first adopted by the Romans and provided for
    for normal years (x,y,z) = (1,5,6). It was the solution suggested by
    Sosigene astronomer of Alexandria in Egypt and adopted by Julius Caesar in 46 a.c. It provided for 31-day January,
    February of 29 days, and from March onwards an alternation of months from 31 days followed by months of 30 days. It was also decided to call August the month after July in honor of Augustus Emperor. It was also decided to change the duration of August from 30 days to 31 days at the same time changing the duration of February from 29 to 28 days in normal years and from 30 to 29 in leap years. It was also decided to reverse the duration of the following months from September to December to avoid three consecutive 31-month months.
    The calendar as we know has been in force since 8 a.c. until the reform of 1582 Gregorian calendar.

  15. Taciturno Amor:

    x + y + z = 12; z = x + 6; so 1, 4, 7 or 2, 2, 8. Took a couple of minutes (too long) owing to poor mental arithmetic!

  16. Daniel McArdle:

    Well that was fun. I’m going to admit to being the slowest person on here. Maybe because I teach Math, rather than do it? Don’t panic – I only teach highschool Math and I spend most of my energy trying to make matieral engaging & intriguing, rather than work on my own thinking skills.
    I must come back here more often though – great place.

  17. Quizzino della domenica: equazione diofantea | Notiziole di .mau.:

    […] Sapete cos’è un’equazione diofantea? È un’equazione (generalmente con più incognite) in cui le incognite possono però avere solo valori positivi. Questo cambia molto le cose: per esempio, l’equazione 2x+3y=10 ha infinite soluzioni tra i numeri reali o anche solo interi, ma se la consideriamo come equazione diofantea l’unica soluzione è x=2, y=2. Risolvere le equazioni diofantee è spesso complicato: per quelle con due incognite esiste un algoritmo noioso, ma se il numero di incognite aumenta bisogna spesso lavorare per euristiche, cioè più o meno provare a caso e vedere come si va avanti. Bene. Dopo tutto questo sproloquio, e tenuto conto che questo è il quizzino numero 366 della mia collezione: riuscite a scoprire se l’equazione diofantea 29x + 30y + 31z = 366 ha soluzioni oppure no? (un aiutino lo trovate sul mio sito, alla pagina; la risposta verrà postata lì il prossimo mercoledì. Problema di Tanya Khovanova.) […]

  18. Fred:

    Lovely question!
    with a nicely unexpected source for the answer.

    At first I felt too lazy to bother.
    Then I realized what these numbers were. Ha ha!
    Nicest thing for my laziness I don’t even need to figure out the precise values of x y z as you merely ask whether there is any solution 🙂 A perfect fit.

  19. Jacob:

    A little harder version:
    28w + 29x + 30y + 31z = 731

  20. Games Developer:

    Channeling Hiren: Now we have two years a leap one and a regular one 365 + 366 = 731 🙂

    So w = 1, x = 1, y = 8, z = 14

Leave a comment