THE CHALLENGESEQUENCE — The sum of the first 100 terms.
Take the sequence defined by U(n+1) = U(n) + 3 with U(1) = 2. Compute and print the sum of the first 100 terms (from U(1) to U(100)).
Write the solution with all three forms of loop (for, while and while True/break), then keep one of them.
Output:
Somme = 15050
Challenge: a single loop (for OR while, your choice) and no sum().
Checks (verified automatically before your code runs):
- At most 1 loop in the whole program (for, while and comprehensions all count).
- Do not use sum().