Inspired from this 9GAG post:
This app simply calculating the next number with "clear" explanation why it should be the next number. Yeah.
Simple, we can always find a f(x)
function that match every number in the given sequence by solving a linear equations:
(with n
is the number of the number in the sequence)
f(x) = x^n + x^(n-1) + x^(n-2) + ... + x + 1
When we found f(x)
, we can easily calculate the next number in the sequence. Wow, much solution!
This app uses Gaussian elimination algorithm found here http://martin-thoma.com/solving-linear-equations-with-gaussian-elimination/
with a small modification to make it work with fraction numbers using mathjs
library.
Make sure you have NodeJS v4.1.1 or above.
npm install
npm start
http://localhost:8763
should now be live with Hot Module Replacement.
npm install
npm run production
Production code placed at build
npm test
Coverage report placed in ./coverage/
directory
npm run staging
build forstaging
environment.npm lint
: linting.