Live data from Hacker News

987654321 / 123456789

johndcook.com

111–120 of 120 posts

Re: 987654321 / 123456789

#112

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…

[deleted]

Re: 987654321 / 123456789

#113

Why the b > 2 condition? In the b=2 case, all three formulas also work perfectly, providing a ratio of 1. And this is interesting case where the error term is integer and the only case where that error term (1) is dominant (b-2=0), while the b-2 part dominates for larger bases.

in the b=2 case, you get: 1 / 1 = 1 = b - 1 1 % 1 = 0 = b - 2 they are the other way around, see for example the b=3 case: 21 (base 3) = 7 12 (base 3) = 5 7 / 5 = 1 = b - 2 7 % 5 = 2 = b - 1

In the b=2 case, 1/1 = 1 = (b-2) + (b-1)/denom(b) = (b-2) + (b-1)/1 = 2b - 3 = (b-1)*b^1 -1 (b-1)

In base 2 (and only base 2), denom(b) >= b-1, so the "fractional part" (b-1)/denom(b) carries into the 1's (units) place, which then carries into the 2's (b's) place, flipping both bits.

Re: 987654321 / 123456789

#114

As a young child, a half of century ago, when I have received an electronic pocket calculator (with 8-digit numbers and without transcendental functions) I was taught that I can do a quick check whether it functions correctly by multiplying 12345679 with 8 (using thus all non-null digits), when the result must be 98765432. Obviously, an additional check is the corresponding division that reverses this operation.

Did you ever encounter a dysfunctional calculator?

That test wouldn't detect a dead left side on the 2nd from-right digit

Re: 987654321 / 123456789

#115
post #83

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.

> the last 2 digits are swapped They are also +9 away from being in order. And then 12345678 * 8 is 98765424 which is +9 away from also being in order.

Oops - the second one was supposed to say +8

Re: 987654321 / 123456789

#116
post #108
post #94

Earlier quoted context omitted.

If you count the sections of your four fingers with your thumb, you can count up to 12 on one hand!

I have always counted to 20 on one hand. even as a kid. base, lower joint, upper joint, top. times 5 - including the thumb: my motor memory is trained so that i switch seamlessly from keeping the curse on top of the finger using my thumb, and then, once i cross 16, switch to using the index finger to "cursor" the thumb.

[deleted]

Re: 987654321 / 123456789

#117
post #114

As a young child, a half of century ago, when I have received an electronic pocket calculator (with 8-digit numbers and without transcendental functions) I was taught that I can do a quick check whether it functions correctly by multiplying 12345679 with 8 (using thus all non-null digits), when the result must be 98765432. Obviously, an additional check is the corresponding division that reverses this operation.

Did you ever encounter a dysfunctional calculator? That test wouldn't detect a dead left side on the 2nd from-right digit

Obviously, that was not intended to be a full-functionality test, but it would detect any frequently-encountered display defect (or keyboard defect).

Calculator displays are multiplexed, so the usual defects are either one digit that never displays anything, or one segment that stays blank on all digits.

The defect mentioned by you is frequent only on displays with independent digits (like some digital clocks), not on calculators.

I do not know whether on calculator LCD displays there are frequent cases when a single segment can become defect.

At the time about which I am talking, calculators had either green vacuum fluorescent displays (like mine) or red LED displays. With such displays, the normal defects were either in the driving circuits or in the connections to the multiplexed display, so they affected either all segments of a digit or the same segment in all digits. I have never seen a case when the actual light-emitting segment of a digit of a VFD or LED display was defect.

Re: 987654321 / 123456789

#118
post #83

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.

> the last 2 digits are swapped They are also +9 away from being in order. And then 12345678 * 8 is 98765424 which is +9 away from also being in order.

I also went about looking at the difference rather than the order. In the hexadecimal case, the difference is 15 (0xEF vs 0x12). I thought, then, that for any base B with ascending digits A and descending digits D, (D-(B-1))/A=B-2.

For binary, it looks like (1-(b-1))/1=b-10 or (1-(2-1))/1=2-2=0 in decimal.

For trinary, it looks like (21-(b-1))/12=b-2 or (7-(3-1))/5=5/5=1 in decimal.

For quaternary, it looks like (321-(b-1))/123=b-2 or (57-(4-1))/27=54/27=2 in decimal.

Essentially and perhaps unsurprisingly, the size of the slices in the number pie get smaller the bigger the pie gets. In binary, the slice is the pie, which is why the division comes out to zero there.

Re: 987654321 / 123456789

#119
post #94
post #88

Earlier quoted context omitted.

That would work in any base, I even think we would find way more interesting coincidences in base 12 (as Sumerians preferred), because it's divisible by 2,3,4,6. It's unfortunate that we have 5 fingers.

If you count the sections of your four fingers with your thumb, you can count up to 12 on one hand!

I am French and we cont extending our fingers from a closed fist. Typically to 2x5=10.

When I was a kid I relized that I can count the fives on the right hand (1 finger for each 5 on the left), which brought me to 25.

It is only when I was traveling in Asia and watched people on markets that I realized that I can use my thumb to count my 12 other finger phalanges, which brought the total to 144. You just need to know your multiplication table of 12 :)

Re: 987654321 / 123456789

#120
post #94
post #88

Earlier quoted context omitted.

That would work in any base, I even think we would find way more interesting coincidences in base 12 (as Sumerians preferred), because it's divisible by 2,3,4,6. It's unfortunate that we have 5 fingers.

If you count the sections of your four fingers with your thumb, you can count up to 12 on one hand!

A system I read about uses the thumb for 5, so that each hand can count (thumb down) 0..4 (thumb up) 5..9.

This gives you the range 0..99. Sweeet.

Post reply on HN