Good day! In my task comes:
Here is a sequence with 5 whole numbers: 2,4,9,20,40,
a) Find the sequence that allows to identify the 6th whole number and with the found formula allows a user to visualize the amount of numbers that he wants to visualize. For example, if the user wishes to display only 3 numbers, he should display on the screen: 2,4 and 9, on the contrary, if the user wishes to display 7 numbers on the screen, he should display on the screen 2,4,9,20,40,? ,? (The ? are those that follow).
for (i = 2; i <= tope; i = i + tope) {
n1 = n1 * 10;
n2 = n2 * 10;
n3 = n3 * 10;
Console.WriteLine(n1);
Console.WriteLine(n2);
Console.WriteLine(n3);
}
Thank you!
Anyone in the community can help you, but you should add code to your question so we can see what you've tried.
I made this function (It's been a long time since I get into C# but the logic is the same)