Reproducible example
Example inputfirst=3
difference=5
terms=20 Expected result Nth term: 98
Nth-term formula: a_n = a_1 + (n - 1) × d
Substitution: 3 + (20 - 1) × 5 = 98
Sum: 1010
Sum formula: S_n = n/2 × (a_1 + a_n)
Substitution: 20/2 × (3 + 98) = 1010
Terms: 20