Phase 6 - Category 1: Number Logic
Apply all learned concepts to solve complex number logic problems.
10 programs · open one, then the next
Start with Complex Number Validation- 01Complex Number ValidationAdvancedCombine positivity, parity, digit count, and digit-sum rules. Students use named booleans and see why every condition must be checked before acceptance.Open example →py# Take a number num = int(input("Enter a number: ")) # Check multiple conditions
- 02Number Meeting Multiple ConditionsAdvancedFilter one through one hundred with three number rules in Python. Students combine shared divisibility, even digit sums, and exclusion of multiples of seven.Open example →py# Find numbers meeting conditions print("Numbers 1-100 that are:") print("- Divisible by 3 and 5") print("- Sum of digits is even")
- 03Perfect Numbers in RangeAdvancedList perfect numbers from one through one thousand with Python. Students reset proper-divisor totals per candidate and compare a completed sum with its number.Open example →py# Find perfect numbers print("Perfect numbers 1-1000:") for num in range(1, 1001):
- 04Armstrong Numbers in RangeAdvancedFind Armstrong numbers from one through one thousand with Python. Students count each candidate's digits, reset its working copy, and use that count as the power.Open example →py# Find Armstrong numbers print("Armstrong numbers 1-1000:") for num in range(1, 1001):
- 05Prime Palindrome NumbersAdvancedPrint numbers that are both prime and numeric palindromes in Python. Students combine reusable helpers, a bounded search, and short-circuit evaluation of and.Open example →py# Helper function def is_prime(n): if n < 2: return False
- 06Numbers with Prime Digit SumAdvancedSelect integers whose decimal digit sum is prime using Python. Students separate the candidate's value from its derived sum and reuse a prime-checking helper.Open example →py# Helper function def is_prime(n): if n < 2: return False
- 07Fibonacci Prime NumbersAdvancedSearch Fibonacci terms for prime values with Python. Students trace pair updates and learn why twenty prime matches can require far more than twenty terms.Open example →py# Helper function def is_prime(n): if n < 2: return False
- 08Happy NumbersAdvancedCheck happy numbers by repeating digit-square sums in Python. Students track visited states and stop either at one or when a repeated state proves a cycle.Open example →pydef sum_square_digits(n): total = 0 while n > 0: digit = n % 10
- 09Abundant NumbersAdvancedList abundant numbers from one through one hundred using Python. Students compare proper-divisor totals with their candidates and keep equality from abundance.Open example →py# Find abundant numbers print("Abundant numbers 1-100:") for num in range(1, 101):
- 10Harshad NumbersAdvancedList Harshad numbers from one through one hundred in Python. Students calculate decimal digit sums and test divisibility by each candidate's own derived total.Open example →py# Find Harshad numbers print("Harshad numbers 1-100:") for num in range(1, 101):