2026
Yes $2026$ is a happy number. * The digits of $2026$ in decimal representation are $2,0,2,6$, and taking the sum of their squares gives $2^2+0^2+2^2+6^2 = 4+0+4+36 = 44$. * The digits of $44$ in decimal representation are $4,4$, and taking the sum of their squares gives $4^2+4^2 = 16+16 = 32$. * The digits of $32$ in decimal representation are $3,2$, and taking the sum of their squares gives $3^2+2^2 = 9+4 = 13$. * The digits of $13$ in decimal representation are $1,3$, and taking the sum of their squares gives $1^2+3^2 = 1+9 = 10$. * The digits of $10$ in decimal representation are $1,0$, and taking the sum of their squares gives $1^2+0^2 = 1+0 = 1$. $2026$ is a happy number because it became $1$ after repeating the operation of replacing itself with the integer obtained by taking the sum of the squares of the digits in its decimal representation five times.
439
No $439$ is not a happy number. Repeating the operation makes it $439 \rightarrow 106 \rightarrow 37 \rightarrow 58 \rightarrow 89 \rightarrow 145 \rightarrow 42 \rightarrow 20 \rightarrow 4 \rightarrow 16 \rightarrow 37 \rightarrow \dotsb$, and it can be proved that no matter how many times the operation is repeated from here, it will not become $1$.
440
Yes $440$ is a happy number.
{
"problem": {
"name": "Happy Number",
"description": {
"content": "You are given a positive integer $N$. Determine whether $N$ is a happy number. A happy number is a non-negative integer that becomes $1$ after repeating the following operation a finite number of time",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc439_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a positive integer $N$. Determine whether $N$ is a happy number.\nA happy number is a non-negative integer that becomes $1$ after repeating the following operation a finite number of time...",
"is_translate": false,
"language": "English"
}
]
}