How do I count thee? Let me count the ways?

Does state life expectancy correlate with political party voting?

Overview       Do people in red states live shorter lives?       This project examines whether state level life expectancy is st...

Monday, February 23, 2026

Years having a month with exactly four weeks

      A year having a month with exactly four weeks will occur in 2026, 2037, 2043, 2054.

      Such a year has February 1 on a Sunday, and is a non-Leap year so February has exactly 28 days.

      Here is the R code:

library(lubridate)

date_sequence <- seq(
  as.Date("2026-02-01"),
  as.Date("2056-02-01"),
  by = "years"
)

df <- data.frame(
  Feb_1 = date_sequence,
  day_of_week = weekdays(date_sequence), 
  is_leap = leap_year(date_sequence)
)

df <- subset(df, day_of_week == "Sunday" & is_leap == FALSE)

cat("The following years have a month (Feb) with exactly four weeks:", (year(df$Feb_1)))

# 2026, 2037, 2043, 2054 

End

No comments:

Post a Comment