Live data from Hacker News

987654321 / 123456789

johndcook.com

51–60 of 120 posts

Re: 987654321 / 123456789

#51
post #43

Earlier quoted context omitted.

.123456... = x + 2 x^2 + 3 x^3 + ... with x = 1/10. Then you have (x + 2 x^2 + 3 x^3 + ...) = (x + x^2 + x^3 + x^4 + ...) + (x^2 + x^3 + x^4 + x^5 + ...) + (x^3 + x^4 + x^5 + x^6 + ...) (count the number of occurrences of each power of x^n on the right-hand side) and from the sum of a geometric series the RHS is x/(1-x) + x^2/(1-x) + x^3/(1-x) + ..., which itself is a geometric series and works out to x/(1-x)^2. Then…

Don't need the clutter of infinite series and polynomials: 1/9 = 0.1111... 1/81 = 1/9 * 1/9 = 0.111... * 0.111... = Sum of: 0.0111... 0.00111... 0.000111... ... = 0.012345...

This is better than my answer, at least if you can get your brain to interpret it in base b. In that case the first two lines would become

  1/(b-1) = 0.1111...
  1/((b-1)^2) = 1/b * 1/b = 0.111... * 0.111... =

Re: 987654321 / 123456789

#52
post #49
post #44

This was by far the most interesting part to me. I've never considered that code and proofs can be so complementary. It would be great if someone did this for all math proofs! "Why include a script rather than a proof? One reason is that the proof is straight-forward but tedious and the script is compact. A more general reason that I give computational demonstrations of theorems is that programs are complementary to…

This is misleading in that the (Curry–Howard) correspondence is between proofs and the static typing of programs. A bug in a proof therefore corresponds to a bug in the static typing of a program (or to the type system of the programming language being unsound), not to any other program bug. (Also: complementary != complimentary.)

i think this is wrong. code is proofs, types are propositions

Re: 987654321 / 123456789

#53
post #49

Earlier quoted context omitted.

This is misleading in that the (Curry–Howard) correspondence is between proofs and the static typing of programs. A bug in a proof therefore corresponds to a bug in the static typing of a program (or to the type system of the programming language being unsound), not to any other program bug. (Also: complementary != complimentary.)

i think this is wrong. code is proofs, types are propositions

The types are the propositions proved by the proof. The proof is correct the program is soundly typed.

Re: 987654321 / 123456789

#54

Somewhat interesting, 123456789 * 8 is 987654312 (the last two digits are swapped). This holds for other bases as well: 0x123456789ABCDEF * 14 is 0xFEDCBA987654312. Also, adding 123456789 to itself eight times on an abacus is a nice exercise, and it's easy to visually control the end result.

Another interesting thing is that these seem to work: base 16: 123456789ABCDEF~16 * (16-2) + 16 - 1 = FEDCBA987654321~16 base 10: 123456789~10 * (10-2) + 10 - 1 = 987654321~10 base 9: 12345678~9 * (9-2) + 9 - 1 = 87654321~9 base 8: 1234567~8 * (8-2) + 8 - 1 = 7654321~8 base 7: 123456~7 * (7-2) + 7 - 1 = 654321~7 base 6: 12345~6 * (6-2) + 6 - 1 = 54321~6 and so on.. or more generally: base n: sequence * (n - 2) + n -…

This is in the original post, in the form

  num(b)/denom(b) = b - 2 + (b-1)/denom(b)
so you just need to clear the denominator.

Re: 987654321 / 123456789

#55
post #43

Earlier quoted context omitted.

.123456... = x + 2 x^2 + 3 x^3 + ... with x = 1/10. Then you have (x + 2 x^2 + 3 x^3 + ...) = (x + x^2 + x^3 + x^4 + ...) + (x^2 + x^3 + x^4 + x^5 + ...) + (x^3 + x^4 + x^5 + x^6 + ...) (count the number of occurrences of each power of x^n on the right-hand side) and from the sum of a geometric series the RHS is x/(1-x) + x^2/(1-x) + x^3/(1-x) + ..., which itself is a geometric series and works out to x/(1-x)^2. Then…

Don't need the clutter of infinite series and polynomials: 1/9 = 0.1111... 1/81 = 1/9 * 1/9 = 0.111... * 0.111... = Sum of: 0.0111... 0.00111... 0.000111... ... = 0.012345...

Isn't it essentially the same thing, but less formal

0.1111... is just a notation for (x + x^2 + x^3 + x^4 + ...) with x = 1/10

1/9 = 0.1111... is a direct application of the x/(1-x) formula

The sum of 0.0111... + 0.00111... ... = 0.012345... part is the same as the "(x + 2 x^2 + 3 x^3 + ...) = (x + x^2 + x^3 + x^4 + ...) + (x^2 + x^3 + x^4 + x^5 + ...)" part (but divided by 10)

And 1/81 = 1/9 * 1/9 ... part is the x/(1-x)^2 result

Re: 987654321 / 123456789

#56
post #44

This was by far the most interesting part to me. I've never considered that code and proofs can be so complementary. It would be great if someone did this for all math proofs! "Why include a script rather than a proof? One reason is that the proof is straight-forward but tedious and the script is compact. A more general reason that I give computational demonstrations of theorems is that programs are complementary to…

[dead]

Re: 987654321 / 123456789

#57
Reminds me of an old calculator trick:

Pick an integer between 1 and 9. Multiple it by 9. Take that number and multiply it by 12345679. (Skip the 8)

>>> 3 * 9

27

>>> 12345679 * 27

333333333

This all works because:

>>> 111111111 / 9

12345679.0

Re: 987654321 / 123456789

#58

Let's prove it. In general, sum(x^k, k=1…n) = x(1-x^n)/(1-x). Then sum(kx^(k-1), k=1…n) = d/dx sum(x^k, k=1…n) = d/dx (x(1-x^n))/(1-x) = (nx^(n+1) - (n+1)x^n + 1)/(1-x)^2 With x=b, n=b-1, the numerator as defined in TFA is n = sum(kb^(k-1), k=1…b-1) = ((b-2)b^b + 1)/(1-b)^2 = ((b-2)b^b + 1)/(1-b)^2. And the denominator is: d = sum((b-k)b^(k-1), k=1..b-1) = sum(b^k, k=1..b-1) - sum(kb^(k-1), k=1..b-1) = (b-b^b)/(1-b)…

If you want to be lazier, after finding the generating functions one can plug into sympy to skip the algebra.

Re: 987654321 / 123456789

#59

I like calculator quirks like this. I remember as a kid playing with the number pad and noticing a geometric center of mass in number sequences ┌───┬───┬───┐ │ 7 │ 8 │ 9 │ ├───┼───┼───┤ │ 4 │ 5 │ 6 │ ├───┼───┼───┤ │ 1 │ 2 │ 3 │ ├───┼───┼───┤ │ 0 │ . │ │ └───┴───┴───┘ I remember seeing that (14787 + 36989) / 2 would produce 25888, in that the mean of geometric shape traced by the two sequences would average out in the…

i remember the 1110 thing on a calc as well.

741 + 369 & 963 + 147 | 123 + 987 & 321 + 789 (left right | up down)

159 + 951 & 753 + 357 | 258 + 852 & 456 + 654 (diagonally | center lines)

the design of a keypad... it unintentionally contains these elegant mathematical relationships.

i call this phenomena: outcomes of human creations can be "funny and odd", and everybody understand that eventually there will be always something unpredictable.

Re: 987654321 / 123456789

#60
> The exact ratio is not 14, but it’s as close to 14 as a standard floating point number can be.

How do you get around limitations like that in science?

Post reply on HN