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 each integer and its square through an entered limit. Students practice a range loop, multiplication, and f-string labels rather than a cumulative sum.Open example →py# Take n n = int(input("Enter n: ")) # Print squares
- 02Print Cubes from 1 to NIntermediateDisplay cubes from one through n with a for loop. Beginners trace three-factor multiplication and distinguish a printed power label from executable arithmetic.Open example →py# Take n n = int(input("Enter n: ")) # Print cubes
- 03Numbers Divisible by 7IntermediateList multiples of seven inside an inclusive interval with Python. Students combine range boundaries, a remainder filter, and shared-line output formatting.Open example →py# Take range a = int(input("Enter a: ")) b = int(input("Enter b: "))
- 04Find HCF (GCD) Using LoopsIntermediateFind a greatest common divisor by scanning possible factors. Students update the best common divisor and see this basic loop's positive-input assumption.Open example →py# Take two numbers a = int(input("Enter first number: ")) b = int(input("Enter second number: "))
- 05Find LCM Using LoopsIntermediateSearch for the least common multiple using loops. Students test increasing multiples, use break on the first match, and note the positive-input requirement.Open example →py# Take two numbers a = int(input("Enter first number: ")) b = int(input("Enter second number: "))
- 06Print All FactorsIntermediatePrint all positive factors of an positive integer with Python. Students trace an inclusive divisor scan and distinguish factors from multiples and remainders.Open example →py# Take number num = int(input("Enter a number: ")) # Print factors
- 07Sum of All FactorsIntermediateAdd every positive factor of a number with a Python loop. Students use a remainder filter, an accumulator, and an inclusive bound that counts the number itself.Open example →py# Take number num = int(input("Enter a number: ")) # Sum factors
- 08Strong Number Check with Iterative FactorialsIntermediateCheck strong numbers with iterative digit factorials in Python. Students trace nested multiplication, zero factorial, and the positive-input requirement.Open example →py# Take number num = int(input("Enter a number: ")) # Calculate factorial function
- 09First N Terms of APIntermediateGenerate arithmetic-progression terms from a starting value and difference. Students use zero-based range positions and see how each position sets the term.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 GPIntermediateGenerate geometric-progression terms with Python exponentiation. Students follow zero-based positions, repeated ratios, and the difference between ** and XOR.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 a symbolic harmonic series without adding it. Students build fraction labels with Python f-strings and place plus signs only between the displayed terms.Open example →py# Take n n = int(input("Enter n: ")) # Print harmonic series
- 12Sum of Harmonic SeriesIntermediateAdd harmonic-series terms and format the total to four decimal places. Students trace Python true division, a floating-point accumulator, and display rounding.Open example →py# Take n n = int(input("Enter n: ")) # Calculate sum
- 13Alternating Series SumIntermediateSum alternating reciprocal terms with conditions. Students trace odd-position addition, even-position subtraction, and a four-decimal display of the result.Open example →py# Take n n = int(input("Enter n: ")) # Calculate sum