As a self learner I am currently learning about triangular numbers, for which the formula is:
$$T(n)=\frac{n(n+1)}{2}$$
While playing with my calculator, I added 1 to each resulted number, and I noticed that none of the results divides by $3$ or $5$
I am assuming that I am correct about this observation, other wise please let me know.
So I have multiplied both sides of the original formula by $2$, and now I have:
$2(T(n))=n(n+1) = n^2+n$
Now my question still remains still wide open:
why is it that $(n(n+1)+1) \bmod 3 \neq 0$ and $(n(n+1)+1) \bmod 5 \neq 0$?
Or you can see it as why $(n^2+n+1) \bmod 3 \neq 0$ and $(n^2+n+1) \bmod 5 \neq 0$?
Or you can see it as why $(1+2+3+4+5+6+\ldots+n)+1$, Basically why a triangular number plus $1$ does not dividing by $3$ nor $5$?
I have tried Google and also tried searching over here, but either I don't know what I am searching for or I simply can't find an answer.
I am trying to pull my head for a possible answer, but I just don't have a clue where to begin with.
Any answers or hints are appreciated. Also if this is a duplicated, I honestly couldn't find it, so please just close and refer me to it.
For this kind of modular arithmetic problems, remember that there are only finitely many numbers to check, when we are dealing with polynomials. This is because $a\equiv b$ mod $n$ implies that $p(a)\equiv p(b)$ mod $n$ as well.
Let $p(x)=\frac12x(x+1)+1$. Then note that $2p(x)=x^2+x+2$, and $2p(0)=2,2p(1)=1,2p(2)=2$. Therefore none of the three possible values of $2p(x)$ are $0$, so $3\nmid 2p(x)$. Since $3\nmid 2$ obviously, then $3\nmid p(x)$. You can do the same thing for $5$ instead of $3$.
It is useful to remember this idea so that you can apply it to other problems too.