Replace an integer N by the sum of the squares of its digits. A happy number is a number that reaches 1 when you repeat this process. Starting from 82:
8*8 + 2*2 = 64 + 4 = 68, repeat:
6*6 + 8*8 = 36 + 64 = 100, repeat:
1*1 + 0*0 + 0*0 = 1 + 0 + 0 = 1 (happy!)
The process reached 1, so 82 is a happy number.
Being happy in base b means writing the number in base b, adding the squares of those digits, and repeating until 1 appears. The same number can be happy in one base and not happy in another. The decimal number 82 is written 10001 in base 3, and in base 3 it is not happy.
Some of the bases got together (yes, they are organized) and hired you for a job: find the smallest integer greater than 1 that is happy in all of the given bases.