Euler's famous formula for generating primes is x^2+x+41=x(x+1)+41, where x is an integer. If we reduce x by 1 we have (x-1)x+41=x^2-x+41, the formula in the question. So the given formula is effectively the same as Euler's formula, which is valid for all integers less than 40. For the given formula, this is equivalent to 41 where the expression becomes 41^2-41+41=41^2. Euler's formula starts with x=0, but the given formula starts with x=1, and produces 40 prime numbers starting at 41. There is no known formula for generating all the prime numbers, but there are some generators capable of generating extremely large prime numbers (the type that fill a page to write out!).