Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer


Let p and q be two positive integers. The sum of all the positive integers up to each of these is p(p+1)/2 and q(q+1)/2. That is, the sum of all integer x for q<x≤p. The difference between these is the sum of all the positive integers between p and q. So if p>q, p(p+1)/2-q(q+1)/2=25×2ⁿ⁺², p²+p-q²-q=25×2ⁿ⁺³, p²-q²+p-q=25×2ⁿ⁺³, (p-q)(p+q)+(p-q)=25×2ⁿ⁺³, (p-q)(p+q+1)=25×2ⁿ⁺³.

So, let p+q+1=25, therefore p+q=24; and p-q=2ⁿ⁺³.

Add these two equations: 2p=24+2ⁿ⁺³, p=12+2ⁿ⁺² and q=24-p=12-2ⁿ⁺².

Since q>0, 12-2ⁿ⁺²>0, 3-2ⁿ>0, 2ⁿ<3, so n≤1. Because p and q are positive integers, n≥-2. q<1000, so 12-2ⁿ⁺²<1000, 3-2ⁿ<250, 2ⁿ>-247, which is true for all n. So the range is -2≤n≤1, making n ∈ {-2 -1 0 1} giving (p,q,n)={ (13,11,-2) (14,10,-1) (16,8,0) (20,4,1) }.

For n=1, q=12-8=4 and p=12+8=20.

4×5/2=10, 20×21/2=210; 210-10=200=100×2.

Therefore 5+6+7+...+19+20=200.

Now let p+q+1=2ⁿ⁺³ and p-q=25. 

p+q=2ⁿ⁺³-1, p-q=25. Add these: 2p=2ⁿ⁺³+24, p=2ⁿ⁺²+12, q=2ⁿ⁺²-13.

q>0, so 2ⁿ⁺²>13, n+2≥4, n≥2. But p<1000, 2ⁿ⁺²+12<1000, 2ⁿ⁺²<988, n≤7.

Therefore, 2≤n≤7.

For n=7, p=524 and q=499.

524×525/2=137550 and 499×500/2=124750, 137550-124750=12800.

Therefore: 500+501+...+523+524=12800.

Continued in comment...

by Top Rated User (762k points)

Note that there are many more solutions to this problem and all can be found by applying the method shown and using all values of n in the discovered range.

Also, (p-q)(p+q+1)=5×(5×2ⁿ⁺³) and solving for simple systems (p-q=5 and p+q=5×2ⁿ⁺³-1) and (p-q=5×2ⁿ⁺³ and p+q=4) produce more solutions for (p,q,n), including:

(642,637,5): 638+639+640+641+642=3200;

(7,2,-2): 3+4+5+6+7=25.

Related questions

Welcome to, where students, teachers and math enthusiasts can ask and answer any math question. Get help and answers to any math problem including algebra, trigonometry, geometry, calculus, trigonometry, fractions, solving expression, simplifying expressions and more. Get answers to math questions. Help is always 100% free!
85,073 questions
90,202 answers
57,906 users