Question: Hi, I'm a beginning SQL student and have the following problem I don't know how to do. Many thanks! Write an anonymous PL/SQL program to

Hi, I'm a beginning SQL student and have the following problem I don't know how to do. Many thanks!

Write an anonymous PL/SQL program to print out the first 10 numbers of Tinos Tacos sequence.

Tino's sequence has the formula F(1)=2, F(n)=F(n-1)+n.

E.g., F(2) = F(1) + 2 = 2+2=4; F(3) = F(2)+3 = 4+3=7

Please use a loop. The numbers you print out should look like

2

4

7

...

56

Hint: you can define a variable f2 for F(n), another variable f1 for F(n-1), and a variable i for n. Think of how to compute f2 using f1 and i and how to update f1 and i in the loop.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!