Skip to content

Instantly share code, notes, and snippets.

@igneus
Created February 15, 2026 21:16
Show Gist options
  • Select an option

  • Save igneus/494284753426036ffd259f26cda8fde0 to your computer and use it in GitHub Desktop.

Select an option

Save igneus/494284753426036ffd259f26cda8fde0 to your computer and use it in GitHub Desktop.
Which are the most frequently skipped Ordinary time Sundays in the given range of years?
# Which are the most frequently skipped Ordinary time Sundays
# in the given range of years?
require 'calendarium-romanum/cr'
SUNDAYS = (2..33).to_a.freeze
SANCTORALE = CR::Data::GENERAL_ROMAN_ENGLISH.load
def skipped_sundays(year)
cal = CR::Calendar.new year, SANCTORALE
r = SUNDAYS.dup
date = cal.temporale.start_date
loop do
date += 7
begin
day = cal[date]
rescue RangeError
break
end
r.delete day.season_week if day.season == CR::Seasons::ORDINARY && day.celebrations[0].rank.sunday?
end
r
end
counts = Hash.new { 0 }
years =
if ARGV.empty?
1970 .. 2100
else
ARGV[0].to_i .. ARGV[1].to_i
end
years.each do |year|
skipped_sundays(year).each do |s|
counts[s] += 1
end
end
counts
.to_a
.sort_by { |(_, skipped_times)| - skipped_times }
.each do |(sunday, skipped_times)|
printf "%i %ix\n", sunday, skipped_times
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment