Number based programs list
Number based programs list
1. Armstrong Number
- A number is an Armstrong number if the sum of its digits raised to the power of the number of digits
equals the number itself.
- Example: `153` → (1^3 + 5^3 + 3^3 = 153).
---
2. Perfect Number
- A perfect number is a number whose sum of its proper divisors (excluding itself) equals the number.
- Example: `6` → Divisors are `1, 2, 3` → (1 + 2 + 3 = 6).
3. Palindrome Number
- A palindrome number reads the same forward and backward.
- Example: `121` → Reverse is also `121`.
4. Prime Number
- A prime number is a number greater than 1 that has no divisors other than 1 and itself.
- Example: `7` → Divisors are `1, 7`.
5. Strong Number
- A number is a strong number if the sum of the factorials of its digits equals the number itself.
- Example: `145` → (1! + 4! + 5! = 145).
8. Happy Number
- A happy number repeatedly replaces the number with the sum of the squares of its digits until it
becomes 1 (happy) or loops endlessly (unhappy).
- Example: `19` → (1^2 + 9^2 = 82 → 8^2 + 2^2 = 68 → ... → 1).
9. Fibonacci Number
- A Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the previous
two.
- Example: `0, 1, 1, 2, 3, 5, 8, 13...`.
Prime factorization of 4: 2 × 2
Sum of digits of prime factors: 2 + 2 = 4
Sum of digits of 4: 4
Since the sums are equal, 4 is a Smith number.