You will find how many terms an arithmetic progression needs to reach a target, and recover the terms from a formula for the sum.
Your tasks.
terms_to_reach, return the smallest for which the sum of the first terms is at least target. The common difference is positive.nth_term_from_sum, return the th term, , from a function S that gives the sum of the first terms.term_12 to the th term of the progression whose sum of terms is .Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…