Problem 2269. Create the following sequence : 0 1 1 4 9 25 64 169 ...
The sequence
0, 1, 1, 4, 9, 25, 64, 169, ...
represents the square of the sequence of Fibonacci numbers.
Let n represent the number of elements to display and let y represent the sequence of squares of Fibonacci numbers.
Example
n = 4 y = [0 1 1 4]
Solution Stats
Problem Comments
-
3 Comments
J.R.! Menzinger
on 8 Apr 2014
you must decide how the input variable is named: 'n', 'nx' or 'x'!! :-/
Ned Gulley
on 8 Apr 2014
I cleaned things up a little.
David Verrelli
on 27 Apr 2018
Hard-coded solutions based on look-up tables for F_n or (F_n)², such as Solution 1506329, should be banned and failed by the Test Suite.
Solution Comments
Show commentsProblem Recent Solvers178
Suggested Problems
-
2900 Solvers
-
Make a random, non-repeating vector.
8750 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1039 Solvers
-
Fahrenheit to Celsius converter
545 Solvers
-
Sum the numbers on the main diagonal
572 Solvers
More from this Author8
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!