Richard O. answered 02/14/24
This is a pair of sequences.
Powers of 3 end in 3, 9, 7, 1, 3, 9, 7, 1...
Squares end in 1, 4, 9, 6, 5, 6, 9, 4, 1, 0...
Therefore, by looking at our options, the only times this would be divisible by 5 is when we have a power ending in a 0 and a square ending in a 4, or a power ending in 1 and a square ending in 6.
So right off the bat I'm sure you can find two solutions.
Here's the part that makes this even easier, I can also tell that 22, 42, 62, 82 are also solutions, because the list lengths have a LCM of 20. So you find how many solutions there are for n<20, then multiply that by 5.