/ find all the weekends for a given year finddayofweek:{[x] numdays: x - `week$ x; vec:`mon`tues`wed`thurs`fri`sat`sun; vec[numdays]} findfirstofmonth:{[year] mons: ("01";"02";"03";"04";"05";"06";"07";"08";"09";"10";"11";"12"); firsts: "D"$' (string year) ,/: (mons) ,\: ("01"); :firsts,'finddayofweek each firsts } year: "I"$ .z.x[0] show findfirstofmonth[year]