|  |         Some possibilities seem to be (k,n) = (2,3), (14,20),
        (84,119), and (492,696).  I'm sure there are more.
        
        Dan
 | 
|  | >    Determine all pairs (k,n) of integers such that
>    
>    	1 + 2 + ... + k = (k+1) + (k+2) + ... + n.
	2 * �k(k+1) = �n(n+1)
8 triangles make a square (like a Union Jack):
	2(2k+1)� = (2n+1)� + 1
So we're looking for solutions to a Diophantine equation, Foo:
	2x� = y� + 1
There can be no even values of x or y which satisfy this equation. (To see this,
consider the equation mod 8.)
This chap is closely related to Pell's equation:
	p� - d*q� = 1
with d=2.
We can see the essential equivalence of Foo & Pell by setting: 
		x=p+q
	        y=p+2q
and seeing that:
		q=-x+y
		p=2x-y
So that every solution to our problem corresponds to a solution to the Pell
business (for d=2) and vice versa.
There is a standard method for solving Pell equations.   See note 57, and I'm
sure it's addressed in other places.   Essentially, all the solutions can be
derived recursively from a primitive solution (the "smallest").   You can get 
at the primitive solution by using continuous fractions.
To be concrete: we can relate the Pell solutions through a matrix equation:
	( p )   ( P  dQ )^n   ( p' ) 
	( q ) = ( Q   P )   * ( q' )
where {p,q} {P,Q} {p',q'} are all solutions, and n is any integer.   We can
take {p',q'} as {1,0} (always a solution of Pell's equation).   Then we can
get all the positive solutions {p,q} through setting {P,Q} = {3,2}, and then
varying n.   By diagonalizing the matrix, we could get a closed expression for
{p,q} in terms of n.
So this allows us to see the solutions to the Pell equation are:
{1,0}
{3,2}
{17,12}
{99,70}
...
This yields solutions to the original problem of the form:
{0,0}
{2,3}
{14,20}
{84,119}
...
Note that here we found the primitive solution {3,2} by inspection.   If d was
bigger, then we'd bring in the continuous fraction machinery.
Cheers,
Andrew.
 | 
|  |     I took this set of problems on holiday to while away one evening after
    a long walk, and returned to find that Andrew had beaten me to this
    one. What can I add, except that the general solution is generated by: 
    
    /n1\ = /3\
    \k1/   \2/
    
    and /n(r+1)\ = /3 4\/n(r)\ + /3\
        \k(r+1)/   \2 3/\k(r)/   \2/  (Those are supposed to be matrices)
    
    How about this extension to the problem, which yields some interesting
    cases:
    
    Find all r,k,n such that
    
        r� + (r+1)� + ... + k� = (k+1)� + (k+2)� + ... + n�
    
    Dick
 |