## ParthKohli one year ago Another problem. Let's go!

1. ParthKohli

Alright, so I think freely when I type - so I'll try to solve this myself. I was able to solve the previous one so I'm hoping that I can do this one just as well.

2. ParthKohli

$(x+1)^p (x-3)^q = x^n + a_1 x^{n-1} + a_2 x^{n-2}+ \cdots + a_n$Obviously, $$n = p+q$$. We have to find the number of ordered pairs such that $$a_1=a_2$$.

3. ParthKohli

$1\le p, q \le 1000$I'll try to think of this in terms of Vieta's Formulas.

4. ParthKohli

So now, here, we have roots $$-1$$ and $$3$$ with multiplicities $$p$$ and $$q$$ respectively. Therefore,$a_1 = - (-1\cdot p + 3 \cdot q) = p - 3q$This one was simple. Now let's try to find out $$a_2$$, which is the sum taken two at a time.

5. ParthKohli

Calling @ganeshie8 because I'm feeling quite lonely here.

6. ganeshie8

$a_2 = -3\binom{n}{2}$ ?

7. ParthKohli

Really? Let's see.$\underbrace{-1, \cdots, -1}_{ p~times}, \underbrace{3, \cdots, 3}_{q ~ times}$In all, there are $$\binom{n}2$$ pairs. Out of those, $$\binom{p}2$$ pairs contribute 1 each and $$\binom{q}2$$ pairs contribute 9 each. The rest contribute -3 each.

8. ganeshie8

Ahh right, $$p\ne q$$

9. ParthKohli

$a_2 = \binom{p}2\cdot 1 + \binom{q}2\cdot 9 + \left(\binom{p+q}2 - \binom{p}2 - \binom{q}2\right)\cdot (-3)$

10. ParthKohli

$= p - 3q$

11. ParthKohli

$a_2 = \frac{p(p-1) + 9q(q-1)-3\left((p+q)(p+q - 1) - p(p-1) - q(q-1)\right)}{2}$

12. ParthKohli

What an ugly expression... let's see if we can size it down a bit.

13. ganeshie8

$$p,q ~\in~\mathbb{N}$$ is it ?

14. ParthKohli

Yup.

15. ParthKohli

Expanded and got$5p^2 - 3q^2 - 3 p - 3q + 6pq = 0$This is some kind of a conic section, ain't it?

16. ganeshie8

$8p+24q+1 = (2p-6q+1)^2$

17. ParthKohli

Wow, that looks better. How do we find integral solutions for this?

18. ParthKohli

Like it means that $$8p + 24q + 1$$ is a perfect square and there aren't many perfect squares in the range 1-1000, but still there are a lot of them and we can't keep track. You're the number-theory guy here.

19. ganeshie8

wait, do we need to find the ordered pairs (p, q) in the range 1-1000 ?

20. ParthKohli

Yeah.

21. ParthKohli

Oh, so we need to look at perfect squares in the form $$8k + 1$$ right?

22. ParthKohli

Well, unfortunately, that means all squares of odd numbers. Haha.

23. ganeshie8

I think so because the left hand side is 8k+1

24. ganeshie8

oh yeah that doesn't help much @mukushla

25. ParthKohli

How did you come up with that form, ganeshie?

26. anonymous

Nice question, It's late here guys, I'll come back to this later :) good night!

27. ParthKohli

BTW, I found this one on Brilliant too...

28. ParthKohli

And good night!

29. anonymous

It must be$p^2 -6pq +9q^2 - 3 p - 3q = 0$

30. anonymous

solve for $$q$$$q=\frac{2p+1 \pm \sqrt{16p+1}}{6}$

31. ganeshie8

does that mean 16p+1 must be a perfect square

32. anonymous

right

33. ganeshie8

Nice! there won't be too many perfect squares of this form is there a nice way to account for divisibility by 6

34. ganeshie8

$j^2 \equiv 1\pmod{16} \implies j\equiv \pm 1, ~\pm 7 \pmod{16}$

35. anonymous

let $$16p+1=n^2$$ which gives$16p=(m-1)(m+1)$now $$m$$ must be an odd number, say $$2k+1$$ $4p=k(k+1)$how about $$k$$? $$k$$ has the forms of $$4l$$ or $$4l+3$$ only.

36. anonymous

* $$16p+1=m^2$$

37. ganeshie8

does that mean $$p$$ has to be an even triangular number ?

38. anonymous

I think yes, let's finish this first

39. ganeshie8

$4p=k(k+1) \implies p =\dfrac{k(k+1)}{2*2}=\dfrac{T_k}{2}$

40. anonymous

aha, counting triangular numbers is easy ha?

41. anonymous

we'll work on that too, from mine you get $$p=l(4l+1)$$ or $$p=(l+1)(4l+3)$$

42. ganeshie8

that looks a lot better! i see where it is going, we work q also similarly right

43. anonymous

we have the quadratic formula, we just need to plug p in terms of l to get q

44. anonymous

guys dont want to disteurb this meeting after u are done can u explain this to me from point blank point thanks

45. ganeshie8

$q=\frac{2p+1 \pm \sqrt{16p+1}}{6} = \dfrac{2p+1\pm (8l+7)}{6}$ ?

46. anonymous

right

47. ganeshie8

subing p also $q=\frac{2p+1 \pm \sqrt{16p+1}}{6} = \dfrac{2(l+1)(4l+3)+1\pm (8l+7)}{6}$

48. anonymous

ok we have some pairs of $$p, q$$ in terms of $$l$$$l(4l+1), \frac{l(4l-3)}{3} \\ l(4l+1), \frac{(l+1)(4l+1)}{3}$

49. dan815

|dw:1435058536781:dw|

50. dan815

51. ganeshie8

right, 4 cases we can start counting i guess... shouldn't be a problem xD

52. anonymous

$(l+1)(4l+3), \frac{(l+1)(4l+7)}{3} \\ (l+1)(4l+3), \frac{4l^2}{3}+l$

53. anonymous

this is not good xD

54. ganeshie8

ok we have some pairs of $$p, q$$ in terms of $$l$$ case1,2 $l(4l+1), \frac{l(4l-3)}{3} \\ l(4l+1), \frac{(l+1)(4l+1)}{3}$ case3,4 $(l+1)(4l+3), \frac{(l+1)(4l+7)}{3} \\ (l+1)(4l+3), \frac{4l^2}{3}+l$

55. dan815

why did u guys change to L =[

56. dan815

|dw:1435059008705:dw|

57. ikram002p

i dont know even what u guys trying to solve i'd like to start over

58. dan815

6 nice equations i think 3 of 4 are pretty trivial

59. ganeshie8

@dan815 equating your expressions for $$a_1$$ and $$a_2$$, we end up with below quadratic : $p^2 -6pq +9q^2 - 3 p - 3q = 0$

60. ganeshie8

then use quadratic formula to isolate $$q$$

61. anonymous

@ganeshie8 wait, I found a better method, this is very short

62. ganeshie8

ok waiting xD

63. anonymous

$(p-3q)^2=3(p+q)$right?

64. ikram002p

eh i feel like pluto being isolated from this mathematicians council -.-

65. ganeshie8

wow ok so $$3\mid (p-3q)^2 \implies 3\mid(p-3q)$$

66. anonymous

$$p+q=3m^2$$ for $$m \in \mathbb{N}$$ and $$p-3q=\pm3 m$$ solve for $$p$$ and $$q$$ in terms of $$m$$ ;-)

67. dan815

there are just 2?

68. dan815

oh theres 1 more qeuation possible

69. ganeshie8

$a_1 = p - 3q\tag{1}$ $a_2 = \binom{p}2\cdot 1 + \binom{q}2\cdot 9 + \left(\binom{p+q}2 - \binom{p}2 - \binom{q}2\right)\cdot (-3)\tag{2}$ @dan815 how did u get ur cases from above two equations

70. dan815

i kept the cases separate

71. ganeshie8

|dw:1435060009607:dw|

72. anonymous

guys I have found the final answer as 19, see if this is right or not

73. dan815

|dw:1435060528572:dw|

74. ganeshie8

19 pairs by both methods!

75. ganeshie8

okie

76. ikram002p

well that was very exhausted question for me to follow, but indeed unforgettable for a last question >.<

77. dan815

I dont see how else u can get it down to only 19

78. dan815

lemme think a little more

79. dan815

ah omg i found my mistake xD

80. ganeshie8

nice :) how many ordered pairs are u getting

81. dan815

hey I was afk, i get the same equations i left it there

82. dan815

|dw:1435075471169:dw|

83. dan815

hmm integer solutions to this eh

84. dan815

|dw:1435075773197:dw|

85. dan815

|dw:1435075838340:dw|

86. dan815

can set a max bound to this now

87. ganeshie8

yes : $$p+q=3m^2$$ for $$m \in \mathbb{N}$$ and $$p-3q=\pm3 m$$ solve for $$p$$ and $$q$$ in terms of $$m$$ ;-)

88. dan815

how come u got p+q = 3m^2?

89. dan815

is it because u know that p+q is an int and we get (p-3q)^2/3 = p+q

90. ganeshie8

|dw:1435076243816:dw|

91. dan815

right okay so lets say (p-3q)^2 = 3*m^2 p-3q=+/- 3m

92. ganeshie8

$$3\mid (p-3q)^2 \implies 3\mid(p-3q) \implies p-3q = 3m$$

93. ganeshie8

|dw:1435076343662:dw|