Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Latest day of Easter is April 25.
- There are 243 days between Easter and Christmas
- Every 400 years the difference between Gregorian and Julian calendar increases by 3.
- Year 300 AD is the reference point for a difference of 1 day between calendars
- Example
- Year Difference
- 200 0
- 300 1
- 400 1 (leap)
- 500 2
- 600 3
- 700 4
- 800 4 (leap)
- 900 5
- Given x the target difference between Gregorian and Julian
- (\floor((x - 1) / 3) * 4 + 3 + ((x - 1) % 3 + 1)) * 100
- ```python
- bucket = (x - 1) / 3
- projectedBucket = bucket * 4 + 3
- positionInBucket = (x - 1) % 3 + 1
- finalPosition = projectedBucket + positionInBucket
- actualYear = finalPosition * 100
- ```
- let x = 243 => actualYear = 32600
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement