Happy Number!

Is 19 a happy number ?

A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits in base-ten, and repeat the process until the number either equals 1 (where it will stay), or it loops endlessly in a cycle that does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy numbers (or sad numbers).

No Yes

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Venkatachalam J
Jan 2, 2018

If a positive integer, replace the number by the sum of the squares of its digits in base-ten and repeat the process until the number equals 1 are happy numbers. If it loops endless in a cycle that does not end in 1 are unhappy numbers.

Definition of a happy number should probably be included in the problem so it does not look like a bad joke to those who have not heard of it.

Marta Reece - 3 years, 5 months ago
Matin Naseri
Jan 2, 2018

Yes . Demonstration

(1 + 9)^2 = 82

(8 + 2)^2 = 68

(6 + 8)^2 = 100

(1 + 0 + 0)^2 = 1.

Ma Pm
Jan 2, 2018

1^2+9^2=82; 8^2+2^2=68; 6^2+8^2=100; 1^2+0^2+0^2=1

It's a happy number

Make it clearly please.

Matin Naseri - 3 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...