You will write the formula for the th term, a function that finds which term a number is, and use them to count.
The idea. . To find which term a number is, , and it must be a whole number of at least .
Your tasks.
nth, return the th term.which_term, return the term number of v as a whole number, or None when v is not a term. Assume d is not .which_term to set count to how many there are.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…