Simple test to see if year is a leap year

  • Context: High School 
  • Thread starter Thread starter moonman239
  • Start date Start date
  • Tags Tags
    Test Year
Click For Summary

Discussion Overview

The discussion centers around determining whether a given year is a leap year, focusing on various proposed methods and rules for identifying leap years within the Gregorian calendar. Participants explore different mathematical approaches and clarify the conditions under which a year qualifies as a leap year.

Discussion Character

  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant claims that all leap years are multiples of 16, suggesting that dividing a year by 16 and checking for a remainder can determine if it is a leap year.
  • Another participant counters that a year is a leap year if it is divisible by 4, unless it is also divisible by 100, and provides examples of leap years that are not multiples of 16.
  • A different participant points out that 2012 is a leap year and questions the logic of the first post based on the division by 16.
  • One participant recalls that a year is leap if it is divisible by four, with exceptions for years ending in two zeros, which must be divisible by sixteen.
  • Another participant elaborates on the leap year conditions, noting that years divisible by 400 are also leap years, and presents a logical expression to describe the conditions.
  • A participant shares pseudocode from Wikipedia that outlines the leap year determination process, emphasizing the distinction between years like 2000 and 1900.
  • Some participants express confusion regarding the division of 2012 by 16, with conflicting interpretations of the remainder.
  • One participant mentions an interesting consequence of the leap year rules related to the occurrence of Fridays falling on the 13th of the month.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correct method for determining leap years, with multiple competing views and interpretations presented throughout the discussion.

Contextual Notes

Some participants' claims depend on specific definitions and interpretations of the leap year rules, and there are unresolved mathematical steps regarding the division of years by 16.

moonman239
Messages
276
Reaction score
0
I just stumbled across this on my own. I find that all leap years in the current calendar are multiples of 16. Therefore, to see if a year is a leap year, one need only to divide the year by 16 and see if there is a remainder. If so, the year is not a leap year. If not, the year is a leap year. Note that this only works for dates in the Gregorian calendar, which was created in 1582 AD but was not universally adopted for a few years. So you'll need to know when the country of interest adopted the Gregorian calendar.
 
Mathematics news on Phys.org
I don't think this is correct. Any year divisible by 4 is a leap year unless it is divisible by 100. For example 2004 and 2008 were leap years and neither one is divisible by 16.
 
I don't follow your logic. 2012 is a leap year. I get 125.75 when I divide 2012 by 16.
 
Iirc a year is leap if it is divisible by four, unless it ends in two zeros then it must be divisible by sixteen.
 
phyzguy said:
Any year divisible by 4 is a leap year unless it is divisible by 100.
Almost. Years that are divisible by 400 are also leap years. One way to write this:
(N = 0\mod 4) \wedge ((N \ne 0 \mod 100) \vee (N = 0 \mod 400))

The test for whether a year is a leap year can be written in a number of ways, but it will always involve three modulus calculations. For example, this also works:
(N = 0\mod 16) \vee ((N = 0 \mod 4) \wedge (N \ne 0 \mod 25))
 
I thought this pseudocode from wikipedia was useful.

if year modulo 400 is 0 then
is_leap_year
else if year modulo 100 is 0 then
not_leap_year
else if year modulo 4 is 0 then
is_leap_year
else
not_leap_year

It helps to see how 2000 was a leap year but 1900 was not.
 
Ynaught? said:
I don't follow your logic. 2012 is a leap year. I get 125.75 when I divide 2012 by 16.

Got it. But the remainder is 3/4.

Updated: If there is a remainder, and its denominator is 4, then the year is a leap year.
 
moonman239 said:
Got it. But the remainder is 3/4.

Updated: If there is a remainder, and its denominator is 4, then the year is a leap year.
No! That would make 1900 a leap year, which it wasn't. It's a three-way test. See posts #5 and 6.
 
An interesting consequence of the leap year rules is that the 13th of the month falls on a Friday more often than 1/7.
 
  • #10
Ynaught? said:
I get 125.75 when I divide 2012 by 16.

moonman239 said:
Got it. But the remainder is 3/4.

I thought the remainder upon dividing 2012 by 16 is 12, not 3/4. :confused:
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
7
Views
2K
  • · Replies 76 ·
3
Replies
76
Views
7K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
32
Views
12K
  • · Replies 3 ·
Replies
3
Views
1K