Advertisement
Guest User

Untitled

a guest
May 1st, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Latest day of Easter is April 25.
  2. There are 243 days between Easter and Christmas
  3. Every 400 years the difference between Gregorian and Julian calendar increases by 3.
  4. Year 300 AD is the reference point for a difference of 1 day between calendars
  5.  
  6. Example
  7. Year Difference
  8. 200 0
  9. 300 1
  10. 400 1 (leap)
  11. 500 2
  12. 600 3
  13. 700 4
  14. 800 4 (leap)
  15. 900 5
  16.  
  17. Given x the target difference between Gregorian and Julian
  18. (\floor((x - 1) / 3) * 4 + 3 + ((x - 1) % 3 + 1)) * 100
  19.  
  20. ```python
  21. bucket = (x - 1) / 3
  22. projectedBucket = bucket * 4 + 3
  23. positionInBucket = (x - 1) % 3 + 1
  24. finalPosition = projectedBucket + positionInBucket
  25. actualYear = finalPosition * 100
  26. ```
  27.  
  28. let x = 243 => actualYear = 32600
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement