Cody

Problem 45253. Pell numbers

Solution 2114753

Submitted on 2 Feb 2020 by Nikolaos Nikolaou
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
n = 3; y_correct = 2; assert(isequal(pell_seq(n),y_correct))

p = 2

2   Pass
n = 6; y_correct = 29; assert(isequal(pell_seq(n),y_correct))

p = 29

3   Pass
n = 9; y_correct = 408; assert(isequal(pell_seq(n),y_correct))

p = 408

4   Pass
n = 12; y_correct = 5741; assert(isequal(pell_seq(n),y_correct))

p = 5741

5   Pass
n = 15; y_correct = 80782; assert(isequal(pell_seq(n),y_correct))

p = 80782

6   Pass
n = 19; y_correct = 2744210; assert(isequal(pell_seq(n),y_correct))

p = 2744210

7   Pass
n = 23; y_correct = 93222358; assert(isequal(pell_seq(n),y_correct))

p = 93222358

Suggested Problems

More from this Author149

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!