Find the sum of the following sequence : 2, 22, 222, ……… to n terms.
Input : 2 Output: 1.9926 Input : 3 Output: 23.9112
A simple solution is to compute terms one by one and add to the result.
The above problem can be efficiently solved using the following formula:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Look-and-Say Sequence
- Connell Sequence
- Alcuin's Sequence
- Aronson's Sequence
- Increasing sequence with given GCD
- Gijswijt's Sequence
- Find F(n) when F(i) and F(j) of a sequence are given
- Gould's Sequence
- k-th number in the Odd-Even sequence
- Aliquot Sequence
- Sylvester's sequence
- Beatty sequence
- Recaman's sequence
- Padovan Sequence
- Farey Sequence
- Golomb sequence
- Juggler Sequence
- G-Fact 21 | Collatz Sequence
- Euclid–Mullin Sequence
- Ulam Number Sequence
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : jit_t