# Sequence with all terms divisible by 8

Let's have the following infinite sequence

3968, 13224, 30624, 59048, ?

What is the next term, replacing the question mark?

Why are all the terms of this infinite sequence divisible by 8?

trolley's really close to the right answer - the only problem is that

when you're dealing with polynomials, the next number after $$1,0,0,1,...$$ is $$3$$, which makes the next squared number $$319$$!

$$3968 = (3 \times 21)^2 - 1, 13224 = (5 \times 23)^2 - 1, \\30624 = (7 \times 25)^2 - 1, 59048 = (9 \times 27)^2 - 1, ... \\101760 = (11 \times 29)^2 - 1$$
If $$3968$$ is $$a(1)$$, then $$a(n) = (2n+1)^2(2n+19)^2-1 = 16n^4+320n^3+1752n^2+1520n+360$$, with all coefficients divisible by 8 as desired.

• You did not answer why all terms are divisible by 8. Can you elaborate on that? Aug 12 at 3:39
• I didn't want to duplicate trolley's response, because there's really not much more to say Aug 12 at 10:12
• Added the full expansion, which gives the justification anyway Aug 12 at 10:19
• No need to calculate the coefficients of the polynomial. Since (2n+1)(2n+19) is odd, letting 2k+1 = (2n+1)(2n+19), we get (2n+1)² (2n+19)² - 1 = (2k+1)² - 1 = (2k+1-1)(2k+1+1) = 4k(k+1) which is a multiple of 8.
– Stef
Aug 12 at 15:19

First, let us notice that

$$3968=63^2-1; 13224=115^2-1; 30624=175^2-1; 59048=243^2-1$$

and next

$$63=1\times60+3; 115=2\times60-5; 175=3\times60-5; 243=4\times60+3$$

so, the generic formula for the $$n$$-th term may be (but not necessarily is - in fact, there may be some different logic used)

$$a_n=(60n-5+8s_n)^2-1$$, where $$s_n$$ is $$1$$ if $$n$$ is a perfect square (i.e. $$n=1,4,9,16...$$) and 0 otherwise (or, a simpler variation, $$\{s_n\}$$ can be just an alternating sequence $$\{1,0,0,1,1,0,0,1...\}$$).

so, the next number is probably (in both variations)

$$a_5=(5\times60-5)^2-1=87024$$

All the terms of this infinite sequence are divisible by 8 because

all of them has the form of "square of odd number minus one", and for any odd number $$2k+1$$ we have $$(2k+1)^2=4(k^2+k)+1\equiv1\pmod8$$, since $$k^2+k$$ is always even for any integer $$k$$.

The next term:

The first four elements of the series can be fitted to the cubic $$8(60x^3+149x^2+290x-3)$$, (where $$x$$ is in the range $$1..4$$), so assuming the same relationship holds for the following terms, the next term (with $$x=5$$) is 101376.

Divisibility by 8

due to the leading factor of 8, all terms will obviously be divisible by 8. So Q.E.D.

Of course, there are an infinite number of possible solutions for any 'sequence' problem, so other answers can be equally valid.

• You used a degree-3 polynomial (4 coefficients) to explain a sequence of 4 terms. To quote von Neumann, "With four parameters I can fit an elephant, and with five I can make him wiggle his trunk."
– Stef
Aug 12 at 15:12
• @Stef which is why I added the final line. The 'accepted' solution was an 'overfitted' degree-4 polynomial.. Aug 12 at 20:39