A comment on A000096
Andrew Plewe
aplewe at sbcglobal.net
Mon Jun 6 19:50:02 CEST 2005
Last week I was playing with triangle numbers and found the following interesting algorithm.
1.) Input your number. In this case, I'll use f = 33.
2.) Find the nth triangle number t closest to f. In this case n = 7 and t = 28.
3.) Compute the remainder r = f - t. In this case 33 - 28 = 5.
4.) Plug r and n into the following quadratic equation:
-3 +/- sqrt(9 + 8 * (n - r))
----------------------------- = q
2
The values for n - r which produce perfect squares are 2, 5, 9, 14, 20, etc., or A000096.
By plugging in and solving, we get two results; q = (-3 +/- 5) / 2, or 1 and -4.
Take the positive result, 1, and subtract this from n (n - q = s), which gives 7 - 1 = 6. If the result is even, then a GCD of (s,
n) will produce a divisor of n. If the result is odd, s will divide n. In our example, n is even, and GCD(6, 33) = 3.
I don't know if this is anything new or not, but it does provide an interesting comment for A000096 and a very fast method for
factoring some numbers (I've been playing with the derivation of this to see if I can come up with a more general solution). I
wanted to run this by the list before submitting it just in case I've made a mistake of some sort. If you're interested, I can send
a more involved derivation of the above quadratic equation. Also I'm a bit intrigued by the negative result that comes out of the
equation, any ideas on what it means? In the above example, subtracting -4 from 7 gives us 11, which evenly divides 33 but I'm not
sure if this is true for all valid integer solutions of the quadratic equation. Thanks!
-Andrew Plewe-
More information about the SeqFan
mailing list