English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

The first two cases are 1 and 36. I could write a computer program to find the others, but is there a formula for this?

2006-08-24 06:47:12 · 6 answers · asked by Chris S 2 in Science & Mathematics Mathematics

6 answers

Can I write it in BASIC?

for x=1 to 10000
if INT(((x^2 + x)/2)^.5) = ((x^2 + x)/2)^.5 then print x
next x

That will give you a printout of all the triangle numbers with base x which are perfect squares.

2006-08-24 07:02:16 · answer #1 · answered by Mr. E 5 · 0 0

Too bad a solution is already known -- I found a great recursive formula but it is not as straightforward as the one on Wikipedia. Oh well, I'll present it any way (without proof).

Definition: T(n) is the n-th triangle number,
[1] ... T(n) = n * (n+1) / 2

Problem: find (x,y) such that x^2 = T(y)

STEP ONE
=========
Find all pairs (a,b) with the property that

[2] ... 2 * T(a) = T(b)

The first few solutions are
(a,b) = (0,0)
(a,b) = (2,3)
(a,b) = (14,20)

From here on, all pairs have the property that a, a+1, b and b+1 are composite numbers; for instance,
14 = 2*7 -- 20 = 2*2*5
15 = 3*5 -- 21 = 3*7

STEP 2
======
Now take any of these pairs and calculate

[3] ... p = 2a+1, q = 2b+1
[4] ... x = pq, y = 2p^2-1

Then (x,y) is a solution of the problem.

This gives two solutions:
(a,b) = (0,0)
(p,q) = (1,1)
(x,y) = (1,1)
and 1^2 = T(1) = 1

(a,b) = (2,3)
(p,q) = (5,7)
(x,y) = (35,49)
and 35^2 = T(49) = 1225

(a,b) = (14,20)
(p,q) = (29,41)
(x,y) = (1189,1681)
and 1189^2 = T(1681) = 1413721

STEP 3
======
Let (a,b) be any solution to the problem, that is, a^2 = T(b). Calculate

[5] ... p = 2a, q = 2b+1
[6] ... x = ab, y = 2a^2

Then (x,y) is also a solution. This process can be applied to one of the solutions found in step 2, but also recursively to those found in step 3.

Based on (1,1) found in step 2 we find
(a,b) = (1,1)
(p,q) = (2,3)
(x,y) = (6,8)
and 6^2 = T(8) = 36

(a,b) = (6,8)
(p,q) = (12,17)
(x,y) = (204,288)
and 204^2 = T(288) = 41616

(a,b) = (204,288)
(p,q) = (408,577)
(x,y) = (235416,332928)
and 235416^2 = T(332928) = 55420693056

etc.

Based on (35,49) found in step 2 we find
(a,b) = (35,49)
(p,q) = (70,99)
(x,y) = (6930,9800)
and 6930^2 = T(9800) = 48024900

(a,b) = (6930,9800)
(p,q) = (13860,19601)
(x,y) = (271669860,384199200)
and 271669860^2 = T(384199200) = 73804512832419600

etc.

Based on (1189,1681) found in step 2:
(a,b) = (1189,1681)
(p,q) = (2378,3363)
(x,y) = (7997214,11309768)
and 7997214^2 = T(11309768) = 63955431761796

etc.


FINAL REMARKS
==============
I have proven that this procedure works in general, and that all solutions can be generated using step 2 and step 3.

Dividing the pairs (p,q) give approximations for sqrt 2. The higher p, the better the approximation. Moreover, the pairs (p,q) found in step 2 lead to approximations q/p < sqrt 2; those in step 3 to approximations q/p > sqrt 2.

For instance,

1/1 = 1.000000000000000000...
7/5 = 1.400000000000000000...
41/29 = 1.41379310344827586...

3/2 = 1.500000000000000000...
17/12 = 1.41666666666666666666...
99/70 = 1.41428571428571428571...
577/408 = 1.41421568627450980392...
3363/2378 = 1.4142136248948696383...
19601/13860 = 1.4142135642135642135...
sqrt 2 = 1.414213562373095048801688...

2006-08-24 15:39:45 · answer #2 · answered by dutch_prof 4 · 0 1

Triangle numbers are found by the formula:

1/2(n^2+n)

Then also square numbers are found by x^2

Would it be possible to take the square root of 1/2(n^2+n) and then find which values of n would equal an integer, and then by working backwards, inserting the value of n into the orginal formula, to get your number. Though i'll leave it down to you to do the square rooting, I mean, I've just got my GCSE results, no need to do too much work right now is there? Hope this helps.

2006-08-24 14:03:08 · answer #3 · answered by Chris 3 · 1 0

There is a (recursive) formula, and the http://en.wikipedia.org/wiki/Triangle_numbers gives it. Following links will get even a closed-form version, which is one of those exponentiating a root messes like the closed-form Fibonacci formulas. It seems easy enough to show the recursive formula generates only triangular numbers which are also square, but I'm not seeing how to show it generates all of them.

2006-08-24 14:11:30 · answer #4 · answered by KimballKinnison 2 · 0 0

Use Java. I did a prime number one.

2006-08-27 16:06:18 · answer #5 · answered by Anonymous · 0 0

next number would be 144,
i think for ex:-
1)1,
2)36,
3)36*4=144
4)144*4=576
5)576*4 and so on.....

2006-08-24 14:00:05 · answer #6 · answered by rx.vinay.ph 2 · 1 0

fedest.com, questions and answers