# Find value of $a_1$ such that $a_{101}=5075$

Let $$\{a_n\}$$ be a sequence of real numbers where $$a_{n+1}=n^2-a_n,\, n=\{1,2,3,...\}$$

Find value of $$a_1$$ such that $$a_{101}=5075$$.

I have

$$a_2=1^2-a_1$$

$$a_3=2^2-a_2=2^2-1^2+a_1$$

$$a_4=3^2-2^2+1^2-a_1$$

$$a_5=4^2-3^2+2^2-1^2+a_1$$

$$\vdots$$

$$a_{101}=100^2-99^2+98^2-97^2+\ldots+2^2-1^2+a_1.$$

Therefore, $$a_{101}=\sum_{i=1}^{50}(2i)^2-\sum_{i=1}^{50}(2i-1)^2.$$

Thus, $$5075=\sum_{i=1}^{50}(4i^2-4i^2+4i-1)+a_1,$$

and, $$a_1=5075-4\sum_{i=1}^{50}(i)+\sum_{i=1}^{50}(1).$$

Hence, $$a_1=5075-4(\frac{50}{2})(51)+50=25,$$

and $$a_1=25$$.

Is it correct? Do you have another way? Please check my solution, thank you.

Yes, your solution is correct. Another method of solution is to note that if $$a_{n+1} = n^2 - a_n,$$ we want to find some (possibly constant) function of $$n$$ such that $$a_{n+1} - f(n+1) = -(a_n - f(n)).$$ This of course implies $$f(n+1) + f(n) = n^2.$$ A quadratic polynomial should do the trick: suppose $$f(n) = an^2 + bn + c,$$ so that $$n^2 = f(n+1) + f(n) = 2a n^2 + 2(a+b)n + (a+b+2c).$$ Equating coefficients in $$n$$ gives $$a = 1/2$$, $$b = -1/2$$, $$c = 0$$, hence $$f(n) = \frac{n^2 - n}{2}.$$ It follows that if $$b_n = a_n - f(n) = a_n - \frac{n^2-n}{2},$$ then $$b_{n+1} = - b_n.$$ This gives us $$b_1 = b_{101}$$ which in terms of $$a_n$$, is $$a_1 = a_1 - \frac{1^2 - 1}{2} = a_{101} - \frac{(101)^2 - 101}{2} = 5075 - 5050 = 25.$$ This solution seems to come out of nowhere, but it is motivated by the idea that if we can transform the given recurrence into a corresponding recurrence for a sequence that is much simpler to determine, we can use this to recover information about the original sequence.

What if at the point where:

$$a_{101} = 100^2 - 99^2 + 98^2 - 97^2 \cdots 2^2 - 1^2 + a_1$$

You opted for a clever factorization of squares:

$$a_{101} = (100 - 99)(100 + 99) + (98 - 97)(98 + 97) \cdots (2 - 1)(2 + 1) + a_1$$

$$a_{101} = 199 + 195 + 191 \cdots 3 + a_1$$

Therefore those numbers become a simple arithmetic series with the first term as 3 and the common ratio as 4.

But how many terms exactly?

$$3 + 4(n - 1) = 199$$

$$4(n - 1) = 196$$

$$n - 1 = 49$$

$$n = 50$$

Therefore with the knowledge of evaluating the sum this comes down to:

$$a_{101} = 25(199 + 3) + a_1$$

$$a_{101} = 5050 + a_1$$

And by substituting the choice for a_101:

$$5075 = 5050 + a_1$$

$$a_1 = 25$$

Thanks to @Zera for recommending the edit. I'm learning how to use these markup languages

• Question to @Zera, is my reasoning the same as yours. I feel like it is – Nεo Pλατo Dec 21 '19 at 16:59

In the most simple way:

$$A_{n+1}+A_n=n^2~~~(1)$$ is a non-homogeneous recurrence equation. Its homogeneous part $$A_{n+1}+A_n=0 \implies A_{n+1}=-A_n \implies A_n= (-1)^n S~~~(2)$$ In the RHS of (1) being $$n^2)$$, we can take $$A_n =P n^2+Q n+R$$; inserting this in (1), we get $$2P=1,P+Q=0,P+Q+2R=0 \implies P=1/2, Q=1/2, R=0.$$ Then the total finally solution of (1) is $$A_n=\frac{n(n-1)}{2}+ (-1)^n S.$$ Given that $$A_{101}=5075$$, finally we get $$A_n=\frac{n(n-1)}{2}+(-1)^{n+1}~ 25.$$

Another way :

$$a_{n+1}=n^2-a_n=n^2-((n-1)^2-a_{n-1})=a_{n-1}+2n-1$$

$$a_{n-1}=a_{n-3}+2(n-1)-1=a_{n-3}+2(n-2)+1$$

$$a_{n+1}=a_{n+1-2r}+\underbrace{2n-1+2n-3+\cdots}_{r\text{ terms}}$$

Here $$n+1=101,n+1-2r=1$$

You could also have notice the pattern $$a_n=(-1)^{n+1}a_1+\frac{n(n-1) }{2}$$