# When n*(n+1)/2 - k is never a square

1. Mar 27, 2015

### OlderOwl

I found that the series represented by An = n∗(n+1)/2 - k never includes a perfect square if and only if the prime factorization of 8∗k+1 includes a prime factor, p, to the ith power where p = +/−3 mod 8 and i is odd and that this can be proved mod p(i + 1)
For instance, $$8* 4 + 1 = 3^1 * 11^1$$ so we can prove mod 9 that n*(n+1)/2 - 4 is never a square. The square residues mod 9 are {0,1,4,7} but for n = 0 to 8 the residues of n*(n+1)/2 - 4 mod 9 are {5,6,8,2,6,2,8,6,5} which are not any of the square residues. Thus n*(n+1)/2 - 4 can never be a square for integer n.
I also found that if 8∗k+1 includes a prime factor, p, to the ith power where p = +/−3 mod 8 and i is odd that k * (2*m+1)2+m(m+1)/2 is a k' such that 8k' +1 also contains p to an odd power in the prime factorization. I was wondering if there is any higher algebra that could prove my findings.

2. Mar 27, 2015

### RUber

Have you worked out the backward problem?
i.e. given $8k+1 = p^i m = (\pm 3)^i (8q )^i$ then $A_n = \frac{n(n+1)}{2} - k$ never contains a square using $\mod p^{i+1}$?

3. Mar 27, 2015

### OlderOwl

I don't see how you get pim ≡ (±3)im ≡ (±3)i(8q)i since p and m both ≡ (±3) mod 8

Last edited: Mar 27, 2015