← Back to challenges

Quad Sequence

PythonHardalgebramathnumbers

Instructions

Write a function that receives a list of x integers and returns a list of x integers in the Nth term of a quadratic number sequence (where x is the length of the incoming list). Your function should return the continuation of the quadratic sequence of the length equal to the length of the given list.

Examples

quad_sequence([48, 65, 84]) ➞ [105, 128, 153]

quad_sequence([0, 1, 6, 15, 28]) ➞ [45, 66, 91, 120, 153]

quad_sequence([9, 20, 33, 48]) ➞ [65, 84, 105, 128]

Notes

Both positive and negative numbers are included in the test cases.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.