It can be shown that (apart from 0 and 1) 2023 is the sole number that equals the sum of its digits multiplied twice by the sum of the squares of its digits. Indeed:

2023 = (2+0+2+3) x (2^2 + 0^2 + 2^2 + 3^2)^2

Are most other numbers n happier (the corresponding product is greater than n) or sadder (the corresponding product is less than n) than n?

  • 2
    $\begingroup$ Shouldn't you be asking if the corresponding product for a number $n$ is greater than or less than $n$? $\endgroup$ Dec 31, 2022 at 20:26
  • 1
    $\begingroup$ @DanielMathias You are right! $\endgroup$ Dec 31, 2022 at 20:33
  • 5
    $\begingroup$ Should have checked my source (Twitter). Freddy Barrera has found other happy numbers: 2400, 52215, 616627, 938600, and 1648656. $\endgroup$ Dec 31, 2022 at 21:35

1 Answer 1


All numbers greater than some threshold are

sadder than the number. Intuitively the sum of digits is roughly the logarithm of the number and the sum of squares of the digits squared is a power of the logarithm of the number, so the calculation is roughly a power of the logarithm of the number, which grows more slowly than the number itself.

To make a bound on the threshold

Let $n$ have $k$ digits. The right side is at most $9k\cdot (81k)^2=3^{10}k^3$ The left side is at least $10^{k-1}$. For $k=9$ the left is $100,000,000$ and the right is $43,046,721$ so all numbers of at least $9$ digits are sadder than the number.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.