次の 13 日の金曜日はいつか?
https://blog.goo.ne.jp/r-de-r/e/272d3d9769162586c72cf886bd89de27
は Dates パッケージで簡単に求まる。
2021/01/01 〜 2029/12/31 までの 13 日の金曜日は?
using Dates
dr = Date(2021):Day(1):Date(2029, 12, 31);
result = filter(dr) do x
dayofweek(x) == Fri && day(x) == 13
end
#=
14-element Vector{Date}:
2021-08-13
2022-05-13
2023-01-13
2023-10-13
2024-09-13
2024-12-13
2025-06-13
2026-02-13
2026-03-13
2026-11-13
2027-08-13
2028-10-13
2029-04-13
2029-07-13
=#
確認
dayname.(result)
#=
14-element Vector{String}:
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
"Friday"
=#