note that I am not a mental mathlete, I just like math.
The first one is not too hard, but it takes a while to do with brute force.
First Question
Basically you have (36^5) / (7^5) so lets start easy.
7x7 is 49, we can ll do that one. 49x49 is still easy, as you can just grab 50x50 (2500) and subtract 99 (once 50 and once 49) to get 2401. Next, 2401 times 7 would be 16807.
36^5 is tougher, and I am sure there are easier ways to do it than I do, but I can figure this out. 36*36 is 1296. 1296x1296 is pretty easy to do as a grid, 1679616 is what I end up with. Using another grid to do that times 36 lets me end up with 60466176.
So, what we want to know is the integer closest to 60466176 / 16807, for as far as I can see, this is irreductible, so we end up with a fun division. This is the easiest bit. Basically I wrote the first 9 multiplications of 16807 and went on with a long division, which was quick to give me 3597 with a leftover of 11397, which is more than half of 16807.
That means the nearest integer is 3598
The second is magic to me, I have no clue how to do this. But the third I can again do with a semi-brute force approach, rather than fully mathematically.
Third Question
The leap year rule is that every 4 years there is a leap year. Every 100 years there is no leap year, unless that year is also divisible by 400. That means that in this question, 1900 is not a leap year. That leaves us with 100/4-1=24 leap years in total.
Now, what parameters need to be met for a year to have 53 sundays? You need at least 52x7+1 days to get 53 of any day, which is exactly 365. That is important, because that means that as long as a leap year starts on a saturday or sunday, there will be exactly 53 sundays in a leap year.
The thing making this easier is that there is a pattern to the days a year starts with. If you let monday be 0, then climb up to sunday being 6, you can find the day any year starts with by adding 1 for every year you add, and adding an additional 1 for every 4 years. meaning you get n+y+⌊y/4⌋ (mod 7) where y is the number years you add, and n is the day on which 1800 started (you could take 1801 as well, but you will see why I pick 1800)
january 1st 2019 was a tuesday, thus a 1. Reversing the formula gets us to 1-219-(⌊219/4⌋)=1-219-54 = -272. Though we also counted 1900 there, that was not a leap year, so lets add one back to get -271. We need a positive number between 0 and 6, so using modulo 7 we get 2, that is a wednesday.
Now we have our equation, 2+y+⌊y/4⌋ (mod 7), and since we only assume leap years, this can be simplified to 2+y/4*5, so our equation adds 5 points for every jump of 4 years. That is a very pretty equation, as it allows us to work from te answer rather than to it.
from our numbered days, we found that we want a 5 mod 7 or 6 mod 7 to be our answer, and we now have an equation that just turns into a +5 per y/4. The chain we get, counting from y/4=1 ( thus year 4, aka 1804) is:
0, 5, 3, 1, 6, 4, 2, 0…
It repeats. That means that every second and every fifth leap year in a cycle of seven is a year with 53 sundays.
4 times 7 is 28, meaning that it repeats every 28 years. That is already 3*2=6 leap years with 53 sundays in 84 years, with 16 years left. that lets us stuff one more leap year into it.
So my answer here is 7 leap years with 53 sundays between 1801 and 1900