Phase 2 - Level 3: Mathematical & Logical Patterns
Master mathematical series, sequences, and logical patterns using loops.
13 programs · open one, then the next
Start with Print Squares from 1 to N- 01Print Squares from 1 to NIntermediatePrint square of each number from 1 to n.Open example →py# Take n n = int(input("Enter n: ")) # Print squares
- 02Print Cubes from 1 to NIntermediatePrint cube of each number from 1 to n.Open example →py# Take n n = int(input("Enter n: ")) # Print cubes
- 03Numbers Divisible by 7IntermediatePrint numbers between a and b divisible by 7.Open example →py# Take range a = int(input("Enter a: ")) b = int(input("Enter b: "))
- 04Find HCF (GCD) Using LoopsIntermediateFind HCF/GCD of two numbers using loops.Open example →py# Take two numbers a = int(input("Enter first number: ")) b = int(input("Enter second number: "))
- 05Find LCM Using LoopsIntermediateFind LCM of two numbers using loops.Open example →py# Take two numbers a = int(input("Enter first number: ")) b = int(input("Enter second number: "))
- 06Print All FactorsIntermediatePrint all factors of a number.Open example →py# Take number num = int(input("Enter a number: ")) # Print factors
- 07Sum of All FactorsIntermediateCalculate sum of all factors of a number.Open example →py# Take number num = int(input("Enter a number: ")) # Sum factors
- 08Strong Number CheckIntermediateCheck if a number is strong number.Open example →py# Take number num = int(input("Enter a number: ")) # Calculate factorial function
- 09First N Terms of APIntermediatePrint first n terms of arithmetic progression (a, d).Open example →py# Take inputs a = int(input("Enter first term (a): ")) d = int(input("Enter common difference (d): ")) n = int(input("Enter number of terms (n): "))
- 10First N Terms of GPIntermediatePrint first n terms of geometric progression (a, r).Open example →py# Take inputs a = int(input("Enter first term (a): ")) r = int(input("Enter common ratio (r): ")) n = int(input("Enter number of terms (n): "))
- 11Print Harmonic SeriesIntermediatePrint harmonic series: 1 + 1/2 + 1/3 + ... + 1/n.Open example →py# Take n n = int(input("Enter n: ")) # Print harmonic series
- 12Sum of Harmonic SeriesIntermediateCalculate sum of harmonic series.Open example →py# Take n n = int(input("Enter n: ")) # Calculate sum
- 13Alternating Series SumIntermediateCalculate 1 - 1/2 + 1/3 - 1/4 + ... ± 1/n.Open example →py# Take n n = int(input("Enter n: ")) # Calculate sum