Hi! I'm having a problem with the integral $\int_{n}^{n+1}x^2 \,dx$ Basically, I noticed that when $n\subset  \mathbb{N}$, $\displaystyle\int_{n}^{n+1}{x^2}\,dx$ gives a prime number divided by 3 or a multiplication of prime numbers.
Here's a table i made.

Is this something already known or a "function that generates prime numbers"?
I don't know much about math and I don't have a great academic background so I'm asking this here.
 A: All numbers are factorizable into some prime numbers by the prime factorization theorem
A: Nice observation. But it does not hold for all $n$. There are plenty of counterexamples. For instance:
For $n=22$, three times the integral is $ 7 \cdot 7 \cdot 31$.
For $n=33$, three times the integral is $7 \cdot 13 \cdot 37$.
For $n=187$, three times the integral is $7 \cdot 13 \cdot 19 \cdot 61$.
A: 91 is also 13 times 7, so it seems to be coincidence that you are finding a few prime numbers.  All other numbers can always be written as a product of prime numbers, (but not necessarily just two) and there isn't a known formula for generating prime numbers.
Your formula for $3n$, which should be $3f(n)$, is $3n^2 + 3n + 1$, if n=26 you get 2107 which is 43 times 7 squared and there are probably higher ones which need 3 or more primes multiplied together, but nice try!
A: Let's come at it from first principles: by direct computation,
$$
\int_{n}^{n+1} x^2 dx = {1 \over 3}\left[ (n+1)^3 - n^3 \right].
$$
Are you testing the statement that the expression in the []'s is either a prime number or a multiple of 3?  If so, this can be tested directly, by expanding the first cube in []'s and collecting the like powers.
A: By the fundamental theorem of calculus,
\begin{align}
f(n)=\int_{n}^{n+1}x^2 \, dx &= \left[\frac{x^3}{3}\right]_{n}^{n+1} \\[4pt]
&= \frac{(n+1)^3}{3}-\frac{n^3}{3} \\[4pt]
&= \frac{3n^2+3n+1}{3} \, .\\
\end{align}
This means that $3f(n)=3n^2+3n+1$. So what we are dealing with is a polynomial that, when you input an integer into it, you get another integer out. Some of the time we will get a prime number. E.g. when $n=1$, we get $3f(n)=7$. But, as Ihf's answer has already noted, some of the time we won't.
Since $3n^2+3n+1=3n(n+1)+1$, and $3n(n+1)$ is even, we know that $3n(n+1)+1$ is odd. If an integer is relatively small and also odd, then it is fairly likely that it is prime. Hence, it shouldn't be too suprising that the polynomial outputs prime numbers for small values of $n$.
