← Back to challenges

Guess the Sequence

JavaScriptHardalgorithmslogicmathnumbers

Instructions

Mubashir is trying to figure out the corresponding quadratic formula for the following quadratic sequence of numbers:

NResult
190
2240
3450
4720
51050

If you can figure this out, then help him by creating a function that takes a number n and returns the nth number of this quadratic sequence.

Examples

guessSequence(1) ➞ 90

guessSequence(2) ➞ 240

guessSequence(3) ➞ 450
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Wurst Is Better