Join the social network of Tech Nerds, increase skill rank, get work, manage projects...

• # fibonaci series using arrays in Ruby

• 0
• 0
• 0
• 0
• 0
• 0
• 0
• 0
• 62
Comment on it

It is a series of Whole number where we have to find sum of the two preceding numbers. It Begins with 0 and 1, the sequence goes like this 0,1,1, 2, 3, 5, 8, 13, 21, 34, etc. using the formula n = n(-1) + n(-2), where the n(-1) is the the last number before n and n(-2) is the second last one before n in the series.

Example

```f = Array.new
f[0] = 0
f[1] = 1

for i in 2..7
f[i] = f[i-1] + f[i-2]
end
for i in 0..7
puts "#{f[i]}"
end
```

## 0 Comment(s)

OR
OR
Register

OR
Fill out the form below and instructions to reset your password will be emailed to you:

• Hire
• Post Projects

### Post Projects

• All at 0 Cost ....
• Post Tech Job
• Select Best Bidder
• Track the Project
• Approve Work and Pay safely
• Browse Nerds
• Work
• Find Projects Find Projects
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Manage
• Company Company

### Manage Company

• All at 0 Cost ....
• Manage Company and Employee Profiles
• Company wide Employee Productivity Reports
• Knowledge Sharing and Collaboration Tools
• Get Sales Lead and Bid for Tech Projects
• Send Invoices and Receive Payment Safely
• Learn
• Nerd Digest Nerd Digest
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General
• Tech Q & A Tech Q & A
• UI Design and UX
• Software Engineering
View more...
View less...
• Marketing
• General