Cody

Problem 45253. Pell numbers

Solution 2125775

Submitted on 12 Feb 2020 by Ryo Ishido
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 = int32 2

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

p = int32 29

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

p = int32 408

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

p = int32 5741

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

p = int32 80782

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

p = int32 2744210

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

p = int32 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!