Sunday, March 28, 2010

As a child, I developed in interest in fractions and decimals, and this is something I noticed.


The decimal expansion of 1/7 is .r142857. (I adopted the notation of placing an "r" before the repeating portion of a decimal, when a bar over the top wasn't feasible.) It has an even number of digits, and if it's split into two groups, the sum is 999.


Many prime fractions have this property, and many don't. For instance, 1/37 = .r027. Or, perhaps closer to home, 1/3 = .r3. If the decimal expansion has an even number of digits, it has this property.


The product of the denominator and the decimal expansion will naturally be 10n - 1, where n is the number of digits in the expansion. So if n is even, n/2 is an integer, and the product can be factored as (10n/2 + 1)(10n/2 - 1). Since the denominator is a prime number and it divides the product, it necessarily divides exactly one of the factors. (No number could divide both, since they're odd numbers with a difference of 2.) Because 10n - 1 is the smallest number with all 9s that the denominator divides, it follows that the denominator must divide (10n/2 + 1).


So what's the consequence of that? It means that (10n/2) divided by the denominator leaves a remainder of one less than the denominator. In the case of 1/7, n is 6 (because the decimal expansion is six digits long), so 10n/2 is 1,000; and, since 1,001 is evenly divisible by 7, 1,000 divided by 7 leaves a remainder of 6.


So what does this have to do with the decimal expansion being split into two groups whose sum is all 9s? Well, think of it this way. If you divide 10n by the denominator, you'll get one iteration of the decimal expansion, and you'll have 1 left over: 1,000,000 / 7 = 142,857, remainder 1. This sets you up for the next iteration. (If you divided 2,000,000 by 7, you'd get 285,714, remainder 2; etc.)


If you instead divide 10n/2 by the denominator, you'll get the first half of one iteration, and you'll have one less than the denominator as your remainder. Example: 1,000 / 7 = 142, remainder 6. This sets you up to divide 6,000 by 7, which will get you back to a remainder of 1.


The general idea is this: (1 / x) + ((x-1) / x) = (x / x) = 1. When the decimal expansion of a prime fraction has an even number of digits, both 1 and x-1 will be included in the same cycle for the reason explained above. (That is, if x divides 10n and n is even, x must also divide 10n/2+1.) If the expansion has an odd number of digits, they will be in different cycles.

Triangular Squares

A triangular number is, of course one-half the product of two consecutive integers (x, x+1); also, the sum of all integers from 1 to the lesser of these.

My conclusion is that if a number is both square and triangular, then x or x+1, whichever is odd, is itself a square, while the other is twice a square. To use 36 as an example:

36 is the sum of 1..8. Therefore, it's 8*9/2. 9 is square, and 8 is twice a square.

Another is 1225: the sum of 1..49. It's 49*50/2. 49 is square, and 50 is twice a square.

Proof:

- Let t be the triangular number, and let n be its integer square root.

- t can be expressed as x(x+1)/2 (and therefore also the sum of integers 1..x).

- Because t can be expressed as the product not only of x*x but also of at least two other integers (either x/2 or (x+1)/2 is an integer), its set of prime factors will contain at least four numbers (and at least two distinct primes) and will be capable of rearrangement into two identical subsets, such that the product of the elements of each will be x. This implies, of course, that the number of prime factors will be even.

- Because 2t is the product of two consecutive integers x and x+1, the number 2 can be inserted into the set with the result that two subsets can be formed, such that their respective products are the two consecutive integers x and x+1.

- x and x+1, being consecutive, are relatively prime; therefore, the intersection between their respective sets of factors is empty.

- Since the set of prime factors of t contains the two identical sets of prime factors of x, and since the intersection between the sets of prime factors of x and x+1 is empty, all instances of any prime factor of t will be in one or the other of these two sets. In additional, one of these sets will contain the number 2.

- Because x and x+1 are relatively prime, if triangular number t is even, then all of the 2s will be in one set. Whether t is even or odd, one of the sets will contain only odd prime numbers.

- Thus, given the two sets of prime factors of x and x+1, one set will consist entirely of pairs of odd prime numbers, while the other will consist of pairs of prime numbers, plus an additional 2.

- Given a set of pairs of odd prime numbers, the product of these numbers is necessarily a square number that's odd.

- Given a set of pairs of prime numbers that also contains an unpaired 2, the product is double a square, and that square can be either even or odd.