Consecutive non-primality P57148


Statement
 

pdf   zip

thehtml

For every natural number x, define N(x) as the smallest natural number y such that yx and such that the 250 consecutive numbers y, y + 1, …, y + 249 are all non-prime.

Your program must print N(x) for every given x.

Input

Input consists of several (probably many) natural numbers x, each one such that N(x) < 109.

Output

For every x, print x and N(x) in one line.

Public test cases
  • Input

    1234
    436273033
    

    Output

    1234 436273010
    436273033 436273033
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++