![]() |
|
|
#23 |
|
Jul 2003
31 Posts |
TravisT thank you.. your explanation was really good.. However there are still some porblems.. Knowing that there is still some problems.. Even 0th elemnt isn`t problem as we can use some trick for example..
if 0th element is 8 and first element is 133 we can just go some elements back and calculate from 133-8=125.. because sequence from 125 up will allways be smaller by 8 if we use the same amount of elements.. (if 0th element is odd number it isn`t so easy but i think i can find solution for that..) However as i said there still is some problems.. With that method we can find weh nsequence will reach some perfect square but it is not said it will be the soonest perfect square in the sequence, but in some cases it could be very important to find the soonest.. for example let fist element be 19 then soonest square is made up form 6 elements because 24*6=144 19+21+23+25+27+29=144 but with your method last member of this chain should be 81.. Yes i could even agree to you because may be it is very last member of this chain as may be i can even proove that after 81 you will never be able to find any perfect squares.. Howevere thank you for showing me the last posible elements.. or terms how do you call them;) |
|
|
|
|
|
#24 |
|
Jul 2003
31 Posts |
Wblipp, sorry, but i think i failed to follow your posted method.. I really think i can understand it, but unfortunately i have very little experiecne in reading math or programming language code.. So bettere please explain on what is based your test..
|
|
|
|
|
|
#25 |
|
Cranksta Rap Ayatollah
Jul 2003
641 Posts |
Annunaki, I tried to explicitly say that what I figured out is definitely not going to give the smallest sequence, because I wasn't sure if that's what you needed, that's why I was hesitant to explain a proof. I haven't really looked through wblipp's algorithm, but the general consensus is that he's got something that will help you out
|
|
|
|
|
|
#26 |
|
Jul 2003
111112 Posts |
anyway thanks a lot for your help.. you gave me 1 new idea and that is much..
...and excuse me for my mistake when i said that including 0th element will be so easy like substracting 0th element form 1ht element and calculating then as it was withouth oth element.. |
|
|
|
|
|
#27 | |
|
"William"
May 2003
New Haven
236610 Posts |
Quote:
We get this transformation by creating two new variables, "a" and "b" that are defined in terms of the old variables "i" (for intial value) and "f" (for final value). The variables are defined by the simple rules: a = (f+1)/2 b = (i-1)/2 These equations can be rearranged to give f = 2a-1 i = 2b+1 dsouza123 has pointed out the sum (when there is not a zeroth term) is sum = ( i + f ) / 2 * ( f - i + 2 ) / 2 If you substitute the i & f equations into this, you will get sum = ((2b+1) + (2a-1))/2 * ((2a-1) - (2b+1) + 2)/2 sum = (2a + 2b) / 2 * (2a + 2b - 2 + 2)/2 sum = (a + b) * (a - b) We can multiply these together to get sum = a^2 - b^2 You want the sum to be a square, so we are looking for sum = c^2. Together, this is c^2 = a^2 - b^2 We can add b^2 to both sides, getting b^2 + c^2 = a^2 Which now has the problem transformed into a problem about Pythagorean triples. If we started with any Pythagorean Triple, we could work backwards to find an "i" and an "f" such that the sum would be a perfect square. For example, the most famous Pythagorean Triple is (3,4,5). If b=3 and c=4 and a = 5, then i = 2b+1 = 7 f = 2a - 1 = 9 And the sum from 7 to 9 is c^2 = 4^2 = 16. This particular Pythagorean triple would not suit our needs unless we were looking for a sum starting with 7. The next step is to figure out which Pythagorean Triples yield the desired initial value. Can you follow it this far? If not, ask questions. |
|
|
|
|
|
|
#28 |
|
Jul 2003
31 Posts |
ok.. I understand you want to usePythagorean theorem to solve this..
first question would be.. how do you figured that you need new wariables thus - a and b.. a=(f+1)/2 and b=(i-1)/2.. yes we ca eaasy calculate one of these waluaes(b) as we know nitial walue (i).. but from where comes our wish to act like this.. i I can`t understand how you chosed the values of a and b.. |
|
|
|
|
|
#29 |
|
Jul 2003
31 Posts |
thus if you didn`t understand my question.. I wish to know why or better how you choosed to define a and b.. Was you just looking what values for a and b you will need to get equation a^2+b^2=c^2.. or you defined
a as (f+1)/2 and b as (i-1)/2 knowing something that i do not know.. ok may be a stupid question.. but i still want to know if there was some specific reasons why you chhose a and b values as they are.. |
|
|
|
|
|
#30 | |
|
"William"
May 2003
New Haven
2×7×132 Posts |
Quote:
I observed that the expression was already close the form (f+i)*(f-i), so I went looking for a transformation that would make it exact. I originally hit on a=(f+1) and b=(i-1) I even went so far as to post using this approach. Later I noticed that because f and i are odd, the a and b are always even. Putting the "divide by two" into the expression resulted in a tigher, more elegant expression. That was the cause of a major edit in my first post. As for "why?" - I've found that lots of interesting things can be done with expressions that have a small number of squares, so I tried to get the expression into this form to see if some of those tricks could be applied. As it turns out, the Pythagorean Triples Trick turned out to be very useful. Any more questions? |
|
|
|
|
|
|
#31 |
|
Jul 2003
31 Posts |
Ok i understood how you transformed our task to Pythagorian triangle..
but now it will be interesting to see how you will use this to solve problem.. do you suggest going through all posible Pythagorian triangles starting from 3;4;5 and continiuing with all next that are posible? ok i am ready to read next part of your alghorithm... |
|
|
|
|
|
#32 | |
|
"William"
May 2003
New Haven
2·7·132 Posts |
Quote:
The next thing to know is that all primitve pythagorean triples - those that do not share a common factor - can be generated by picking two numbers "p" and "q" and creating the triple (2pq, p^2-q^2, p^2+q^2). It's easy to show this is always a Pythagorean Triple - For example, pick p=2 and q=1, we get (4, 3, 5) - the most famous Pythagorean Triple. Pick p=3, q=2 we get (12, 5, 13), another famous triple. Pick p=17 q=4 we get (136,273,305) - a relatively obscure triple. If we put these two facts together, we have that by picking any three numbers, "d", "p", and "q", we can generate a Pythagorean Triple (2dpq, d*(p^2 - q^2), d*(p^2 + q^2)) So how do we find Pythagorean Triple that match our initial conditions.? Let's work though a simple example, with i=77. We know that b=(i-1)/2, so b = (77-1)/2 = 38. How can we find Pythagorean Triples with 38 as one of the "side legs"? One way to do this is to pick the "2dpq" leg. Then we need solutions to 2dpq=38 dpq=19 There are only 3 ways to pick 3 numbers that multiply together to make 19 - 19,1,1 and 1,19,1 and 1,1,19. We can ignore the last one because swapping p and q results in the same Pythagorean Triple. So we have two sets of values for d, p, q. This results in two Pythagorean Triples that match up with i=77: (b,c,a) = ( 38, 0, 38 ) or ( 38, 360, 362 ) For each case we can calculate the final value from f=2a-1. This gives us final values of 75 or 723. We can also calculate the square root as c - the two square roots are 0 and 360. The case of f=75 and c=0 is a funny solution that we have seen before. It means that if you stop before you start you get zero - that's usually an uninteresting solution. The only other solution is that adding from 77 to 723 results in 360 squared. This example gave very few results before there were very few ways to pick d, p, and q. See the previous example for a case that had 152 different was to pick d, p, and q, resulting in 74 different squares. There is one more issue that needs to be discussed, but let's see if you have any questions so far. |
|
|
|
|
|
|
#33 |
|
Jul 2003
31 Posts |
hmm.. i will look at it a little bit later.. but for now it seems that it may be something good.. Hovewer we need to find a way to include 0th element..
and in general case i need only to find soonest square not all of them.. but of course this mehod still looks good for now.. |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Arithmetic progressions for n | MattcAnderson | MattcAnderson | 28 | 2017-05-08 20:58 |
| Compositions of arithmetic progressions | jasonp | Factoring | 8 | 2011-08-20 13:42 |
| Detecting arithmetic progressions | grandpascorpion | Math | 18 | 2007-03-28 15:08 |
| Prime progressions... | Xyzzy | Math | 11 | 2004-12-17 17:00 |
| Determining cause of Primenet error 29s | NookieN | Software | 5 | 2003-07-11 19:19 |