Optiver Interview Question

Mental Math and some sequences