It turns out that 2009 is not a prime number, as I briefly wondered if it might be. In fact, one of its several divisors is a perfect square. What is that factor?
While you’re killing time on meaningless stuff (I imagine Friday is going to be a slow work day, if you’re in the office at all): what was the last year that had such a large perfect square as a factor? What will be the next one?
And what year is the next prime number?
Solution and code after the break.
- Perfect square divisor found. 2009 is divisible by: 7^2 (49)
- 2011 is a prime!
- Perfect square divisor found. 2000 is divisible by: 10^2 (100)
- Perfect square divisor found. 2016 is divisible by: 12^2 (144)
And the code: