-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/E/B d-- s:++>: a-- C++(++++) UL++ P! L++ E--- W+++ N+++ w PS+ PE- !tv
b+++ G++ e++ h
------END GEEK CODE BLOCK------

## Monday, October 18, 2004

### Cubes and Squares

There are two whole numbers,difference of their squares is a cube and difference of their cubes is a square.
These are the smallest possible numbers.

Kannappan said...

The only clue I got till now is that atleast One of the two numbers cannot be below 1000.

Kannappan said...

Provided the question isnt a riddle ^_^)

Kannappan said...

The results of first 100 numbers are here

A. Difference of cubes of two numbers which is a square

Number 7
Number 8
Difference = 169

B. Difference of squares of two numbers which is a cube.

Number = 1
Number = 3
Difference = 8

Number = 3
Number = 6
Number = 27

3
15
216

6
10
64

6
42
1728

8
24
512

10
15
125

11
43
1728

13
14
27

15
17
64

15
21
216

15
35
1000

15
60
3375

21
28
343

24
48
1728

25
29
216

27
81
5832

28
36
512

35
63
2744

36
45
729

39
57
1728

45
55
1000

46
62
1728

48
80
4096

49
76
3375

53
55
216

55
66
1331

55
80
3375

62
63
125

62
66
512

63
99
5832

66
78
1728

78
91
2197

Kannappan said...

Two completely *ineffective* perl scripts for doing the above is here. Do u hav any improvements ??????
The scripts consumed 45% CPU each....Imagine the extent of ineffectiveness :)

A. Difference of cubes of two numbers which is a square

\$temp=100;
\$k=1;
while (\$k<\$temp)
{

\$i=1;
while (\$i<\$temp){

\$j=\$i*\$i*\$i - \$k*\$k*\$k;
if (\$j>0) {
\$a=1;
while(\$a < 20) {
\$squire=\$a*\$a;
if (\$j == \$squire){
print("\$k\n");
print("\$i\n");
print ("\$j\n");
print("\n\n");
}
\$a=\$a+1;
}
}
\$i=\$i+1;
}

\$k=\$k+1;
}

B. Difference of squares of two numbers which is a cube

\$temp=100;
\$k=1;
while (\$k<\$temp)
{

\$i=1;
while (\$i<\$temp){

\$j=\$i*\$i - \$k*\$k;
if (\$j>0) {
\$a=1;
while(\$a < 20) {
\$cube=\$a*\$a*\$a;
if (\$j == \$cube){
print("\$k\n");
print("\$i\n");
print ("\$j\n");
print("\n\n");
}
\$a=\$a+1;
}
}
\$i=\$i+1;
}

\$k=\$k+1;
}

Kannappan said...

The scripts started consuming 45% cpu when wanted to check for numbers upto 10000. Otherwise it was quite normal.

phoe6 said...

!riddle

Kannappan said...

http://www.dansmath.com/probofwk/probs12.html

Problem No. 118 b)

havent yet seen the answer....lemme try exhausting my tries before checkinn the answer

Kannappan said...

http://www.dansmath.com/probofwk/probs12.html

Problem No. 118 b)

havent yet seen the answer....lemme try exhausting my tries before checkinn the answer

Kannappan said...

hey, atleast one of the answers will be grater than 10,000. What do u say ???

Kannappan said...

correction :::

atleast One of the numbers is grater than 5000.
ten thousand am not sure//

phoe6 said...

Frankly speaking,me too working on this.this should not be a difficult problem as it seems.

Kannappan said...

Hey hey hey ...A big mistake in my script...which I just now noticed...Oh GOd...teh anwer is simple 6 and 10...
The problem in the first script is the assigning of the variable \$a=20....I just changed it to 100...So that we can compare the diferenc of the cubes to upto square of 100.....

The difference between cubes of 6 an 10 leads to 784 whose square root is 48. In my script i compared only till 20 :(

So All the previous results die here...
The Answer is 6 and 10...And hey I havent seen the answer as yet...for my 2 secs of fame that is :)

phoe6 said...

Well, you win!

Mine went like this:
took a notebook and wrote:
1 1 1
2 4 8
3 - 9 - 27
4 - 16 - 64
5 - 25 - 125
6 - 36 - 216
7 - 49 - 273
8 - 64 - 512
9 - 81 - 729
10 - 100 - 1000

manually took up numbers to get the first thing, surprisingly landed up at 6,10 but I guess that moment I overlooked/ lost sight and went ahead :) to write futile C program. :(
sometime later checked your comments..only to jump back and check the paper where I had calculations.. verified with sqrt(784) ...
oh, dont to loose track.

Kannappan said...

Your approach to the problem is structured and good.
I went right away for the brute force. Only after sometime sat to check if there are some algebraic ways of solving the problem. Say something like using the formulas of
(a power 2)- (b power 2) = (a-b)*(a+b)
(a power 3)-(b power 3) = (a-b)*(a power 2 + ab + b power 2)

Continued thinking in this way only to see my head turn a lil more bald. huh

Anyhow there surely has to be some way of solving this problem other than brute force.

Out of Context http://math.ucr.edu/home/baez/dublin/index.html#preskill

Back to context:
I dint believe the problem had a smaller answer. Part of the reason for this thought was my working on another problem which have a sol for only very high numbers.

Problem no.5 on

Looks like an easy prob. But this is pegging the mind for a lot lot time.

Kannappan said...

There is this problem which consumed hours on paper and tried upto number 1000 and lil beyond. Yet unable to find answer

problem No.17 on

Kannappan said...

Using Brute Force and a comp program, the olympiad problem is solved as (1,1) (16,2) (27,3) for (a,b). Cant identify any pattern and dunno as yet how to solve it by hand.

phoe6 said...

>>problem No.17 on

199981Woah! :))

Kannappan said...

Yeah the answer is 199981. Cool man.

The funny part is after 1 after many numbers it doesnt match...but matches only at 199981 and obviously matches from there on for the next 9 numbers until 199990.

then 200000, 200001 also match.

The result upto 100 lacs is

1

199981
199982
199983
199984
199985
199986
199987
199988
199989
199990
200000
200001

1599981
1599982
1599983
1599984
1599985
1599986
1599987
1599988
1599989
1599990

2600000
2600001

What pattern to make here... huh :)

Kannappan said...

One for the mind

Hey the problem no.1 on