11 ms·
1/9998 = 0.0001 0002 0004 0008 0016 0032 0064 0128 0256..
- Navarr 13y agoBreaks at 8,192 of course...
- Danieru 13y agoTo expend it all you have to do is add more nines.
- Zikes 13y agoApparently you can add 9's to increase the number of digits in the result.
- jng 13y agoIt doesn't really "break" so much as it shows the sum of partially overlapping entries, natural since they dont fit in 4 digits.
- fantnn 13y agoThe last power of 2 with 4 digits; I have no idea why this has even been posted not discussion worthy in the least IMO.
- neals 13y agoOk, I hope somebody has a really good logical explanation of this, or maybe even some other awesome examples?
- pja 13y agoThe fact that 10000 - 2 = 9998 probably has something to do with it. Compare and contrast the result for 1 / 99998.
- archgoon 13y agoPretty much. 1/9998 = 1/(10000-2) = 1/(10000)*1/(1-2/(10000) Since 2/10000 is very small, it is well approximated by the taylor expansion for 1/(1-x), which is simply Sum(x^n) Since x is 2/10000, we get powers of two, which keep getting shifted to the right. Like a bit pattern, they don't overlap when added, so we get the sequence above.
- fjcaetano 13y agoSorcery!
- camus2 13y agomath voodoo ! it's beautifull indeed.
- elektronaut 13y agoSimilarily, 1/9999 gives you powers of 1 (which is just 1), 1/9997 powers of 3, and so on.
- cangencer 13y agoA mathematical explanation: http://calculus7.org/2012/02/25/playing-with-numbers-998001-explained/ http://calculus7.org/2012/02/25/playing-with-numbers-998001-...
- impendia 13y ago1/(1 - x) = 1 + x + x^2 + x^3 + x^4 + ... so, 1/(1 - .0002) = 1 + .0002 + .0002^2 + ... and 1/9998 = .0001/(1 - .0002).
- ronaldx 13y agoExplanation: 0.0001+0.00000002+0.00000000004 etc = 2^0/10^4 + 2/10^8 + 2^2/10^12 etc which is a geometric sequence with common ratio 2/10000 and first term 1/10000 So it has an infinite sum of (1/10000)/(9998/10000) = 1/9998 Same for powers of 3: 1/9997 Actually 1/8 = 0.125 is an example of this; it just breaks down very early because 4+0.8+0.16+0.032+0.0064+... = 5
- deleted 13y ago[deleted]
- nanofortnight 13y agoSimple high-school maths. S = 0.00010002000400080016... S = 0.0001 + 0.0000 0002 + 0.0000 0000 0004 + 0.0000 0000 0000 0008 + ... S = 2^0 / 10000^0 + 2^1 / 10000^1 + 2^2 / 10000^2 + 2^3 / 10000^3 + ... S = sum to infinity of (2/10000)^i You might have noticed this is a geometric series with ratio 2/10000 = 0.0002. S = 0.0001 / (1 - 0.0002) = 0.0001 / 0.9998 = 1/9998
- crntaylor 13y agoThe pattern will break down once you get past 8192, which is 2^13. That means that the pattern continues for an impressive 52 significant figures (well, it actually breaks down on the 52nd digit, which will be a 3 instead of a 2). The reason it works is that 9998 = 10^4 - 2. You can expand as 1 / (10^n - 2) = 1/10^n * 1/(1 - 2/10^n) = 1/10^n * (1 + 2/10^n + 2^2 /10^2n + 2^3 /10^3n + ...) which gives the observed pattern. It breaks down when 2^k has more than n digits, which happens approximately when 2^k > 10^n => k > n log(10) / log(2) which comes out to 4 * log(10)/log(2) = 13.28 when n = 4. --- Another pattern can be generated from the power series expansion x / (1 - x)^2 = x + 2x^2 + 3x^3 + 4x^4 + ... setting x = 1/10^n gives the infinite series 1/10^n + 2/10^2n + 3/10^3n + ... which leads to the neat fact that 1 / 998001 = 0.000 001 002 003 004 005 006 007... --- Another example is the fraction 1000 / 997002999 = 0.000 001 003 006 010 015 021 ... which goes through the triangle numbers[0] in its expansion, or 1 / 998999 = 0.000 001 001 002 003 005 008 013 021 ... which goes through the Fibonacci numbers[1]. --- Getting the squares is harder, but you can do it with 1001000 / 997002999 = 0.001 004 009 016 025 036 049 ... [0] http://en.wikipedia.org/wiki/Triangle_number http://en.wikipedia.org/wiki/Triangle_number [1] http://en.wikipedia.org/wiki/Fibonacci_number http://en.wikipedia.org/wiki/Fibonacci_number
- rsiqueira 13y agoThe pattern is not really breaking. What happens is that 16384 doesn't fit in a 4 digit space so it's first digit "1" jumps to 8192 and it becomes 8193. Then the next number (32768) add it's first digit "3" to 16384 and it becomes 16387 and so on, so the sequence appears strange after 4096: ...409681936387...
- deleted 13y ago[deleted]
- qdpb 13y agoI think that's what you would call a break in a pattern though. Of course, the infinite series will stay infinite.
- deleted 13y ago[deleted]
- emillon 13y agoΣ(2^i / (10^(5i)) = Σ(2/10^5)^i = 1/(1-(2/10^5)) = 10000/9998 (you get the idea)
- huhtenberg 13y ago1/9998 is 1/(10000-2) is (1/10000) / (1 - 2/10000) which is an infinite sum of geometric progression with an initial value of 1/10000 and ratio of 2/10000. In other words, x1 = 1/10000; // 0.0001 x2 = x1 + x1 * 2/10000; // 0.0001 0002 x3 = x2 + x2 * 2/10000; // 0.0001 0002 0004 0008 ... Magic O_O [0] http://en.wikipedia.org/wiki/Geometric_progression http://en.wikipedia.org/wiki/Geometric_progression
- huherto 13y agoPretty cool. Can we use WolframAlpha to show why 0.1 cannot be represented as a floating binary? And why floating numbers shouldn't be used for currency operations.
- al2o3cr 13y agoYes. http://www.wolframalpha.com/input/?i=1%2F10+in+base+2 http://www.wolframalpha.com/input/?i=1%2F10+in+base+2 TL;DR: 1/10 has an infinite repeating binary expansion. (think 1/3 in decimal - 0.3333333) The part that really gets you into trouble is that the repeating pattern is 0011, which means it rounds differently depending on how many digits of precision you give it.
- LePoneyRouge 13y agoYou can add 9 for more digits per power of 2: http://www.wolframalpha.com/input/?i=1%2F99998 http://www.wolframalpha.com/input/?i=1%2F99998
- dsugarman 13y agoeveryone seems to be concerned with the point at which this breaks. You determine this, the size of the denominator gives you the precision you can calculate: 1 / 99998 will return: 0.00001 00002 00004 00008 00016 .... [0]http://www.wolframalpha.com/input/?i=1%2F99998&dataset=&equal=Submit http://www.wolframalpha.com/input/?i=1%2F99998&dataset=&equa...
- Trufa 13y agoReminds me of being bored in high school.
- viame 13y agoExcept your high school math teacher probably didn't know this one, and they still don't. Otherwise you wouldn't be bored. Haha :D
- sp332 13y ago"Let's say you're me, and you're in math class, and you're supposed to be learning about exponential functions but you're having trouble caring..." https://www.youtube.com/watch?v=e4MSN6IImpI https://www.youtube.com/watch?v=e4MSN6IImpI Vi Hart's whole channel is great, and most of the videos start like that.
- rsiqueira 13y agoI found this division 1/9998 by chance. I was trying to remember the number from a previous HN discussion, that was 1/998001 = 1.002 003 004 005 006 007...: https://news.ycombinator.com/item?id=3514721 https://news.ycombinator.com/item?id=3514721
- madcaptenor 13y agoAs people have pointed out: 1/98 = 0.01 02 04 08 16 32 ... 1/998 = 0.001 002 004 008 016 032 064 128 256 ... but there's also a degenerate case, where you have no 9s at all: 1/8 = 0.1 + 0.02 + 0.004 + 0.0008 + ... and what's surprising here is that everything adds up and gives you the terminating decimal 0.125 that you were expecting.
- prezjordan 13y ago> 1/8 = 0.1 + 0.02 + 0.004 + 0.0008 + ... The sum of a convergent series is a / (1 - r) where a is the first value, and r is the ratio between the n+1th and nth term. a = 1/10, r = 1/5 n = (1 / 10) / (1 - (1 / 5)) n = (1 / 10) / (4 / 5) n = 5 / 40 n = 1 / 8
- madcaptenor 13y agoI knew that. I left it as an exercise for the commenter.
- kachnuv_ocasek 13y agoI gotta be that guy: Why is this the first post on the front page of Hacker News? Is basic arithmetic really so fascinating to the computer people?
- adt2bt 13y agoI hope you can see why this example of basic arithmetic is really neat. It reminds us that there are hidden patterns everywhere. Oftentimes, we can determine why the pattern exists with math. It never hurts to be reminded how cool it is to learn.
- arbitrage 13y agoIn fact, you do not have to be that guy. Different people find different things interesting; just let it go.
- bnegreve 13y agoTrue, however, I am also surprised that it's getting this much attention.
- pg_is_a_butt 13y agolooks like someone doesn't understand anything about number theory and how computer's actually work with number representations to make your stupid fucking twitterbook feed work. you're an idiot.
- pg_is_a_butt 13y agolooks like someone doesn't understand anything about number theory and how computers actually work with number representations to make your stupid fucking twitterbook feed work. you're an idiot.
- dwaltrip 13y agoThere is a little more going on here than basic arithmetic. See the top comment for further evidence: https://news.ycombinator.com/item?id=7144804 https://news.ycombinator.com/item?id=7144804. But yes, non-math-geeks will probably find this uninteresting. Apparently HN has a lot of math geeks ;)
- yammesicka 13y agoThis one is also interesting: http://www.youtube.com/watch?v=daro6K6mym8 http://www.youtube.com/watch?v=daro6K6mym8
- antimatter15 13y agoIn high school, I was pretty fond of plugging 11^n to get rows of Pascal's triangle. It breaks down at row 5, but inserting 0's in the middle extends it (e.g. 101^n, 1001^n, 10001^n). 11^0 1 11^1 1 1 11^2 1 2 1 11^3 1 3 3 1 11^4 1 4 6 4 1
- geoffhotchkiss 13y agoIt actually doesn't break, you just have to do the carries as you would during normal addition. You have to read from right to left (1's place, 10's place, 100's place, and so on). So you're really just converting to base 10. 5th row: 1 5 10 10 5 1 Writing this a bit backwards, 1 * 1 + 5 * 10 + 10 * 100 + 10 * 1000 + 5 * 10000 + 1 * 100000 = 161051 = 11^5.
- tryeng 13y agoYou can of course do this trick in any base. If we choose e.g. base 2^n for the n-th row of pascals triangle, we can use the following code for getting the n-th row of pascals triangle: def pascal(n): base = max(2, 2**n) row = (base+1)**n return [row/base**i % i for i in range(n+1)] Nice, but hopelessly inefficient. :) You can also calculate a binomial coefficient the same way without any looping construct (the exponential operator does the looping for you).
- diydsp 13y agoOn a vaguely similar, yet less practical note: 111,111,111 * 111,111,111 = 12,345,678,987,654,321 :)
- jloughry 13y agoOn most pocket calculators, 11111111×= will yield 12345678. People are often surprised that that sequence is accepted. To me, it exposes something about the calculator's internal architecture. It's also a useful self-test if you think the battery might be going.
- achalkley 13y agoWhat does this mean?
- bcoates 13y agohttp://www.wolframalpha.com/input/?i=series+representation+of+%281+%2F+%2810%5E4+-+k%29+%29 http://www.wolframalpha.com/input/?i=series+representation+o...
- dewiz 13y agoSimilar nicety on tartaglia's triangle, which represents infinite powers of 11
- chenster 13y agoNot related, but 12345679 * 8 = 98765432
- cncool 13y ago987654321/123456789 = 8.0000000729
- obfuskater 13y agoJust add more 9's to the divisor to make the pattern work for larger numbers: 1/99998 = 0.00001 00002 00004 00008 00016 00032 00064 00128 00256 00512..
- swayvil 13y agoat about 10^200 decimal places in we found instructions for building an ansible.
- Xcelerate 13y agoHere's a generalization for any arithmetic sequence. With first term a0, difference d, and digit "padding" of n, the fraction that will result is: (a0 + (d - a0)(1/10^n)) / (1 - 1/10^n)^2 For instance the sequence 1, 4, 7, 10, 13... (1 + (3 - 1)(1/10^2)) / (1 - 1/10^2) = 1.02 / 0.9801 = 3400/3267 = 1.004 007 010 013 016... For any kind of recursive sequence, you can find its generating function G(x) and then substitute some integer power of 0.1 for x to generate cool decimal expansions like this. The generating function for the Fibonacci sequence is: G(x) = x / (1 - x - x^2) Substituting in 0.001 gives 0.001 / 0.998999 = 0.001 001 002 003 005 008...
- pitchups 13y agoNeat! Not familiar though with generating functions - can you pls explain how the generating function for the Fibonnaci sequence is x/(1 - x - x^2 ) ?
- blt 13y agoGenerating functions are amazing. One of the coolest topics in my entire undergrad math degree. This PDF is well written and will explain everything: http://courses.csail.mit.edu/6.042/fall05/ln11.pdf http://courses.csail.mit.edu/6.042/fall05/ln11.pdf
- PhilipTai 13y agoFor Fibonacci sequence, x = 1x^1 x * g(x) = 1x^2 + 1x^3 + 2x^4 + 3x^5 + 5x^6 + ... + x^2 * g(x) = 1x^3 + 1x^4 + 2x^5 + 3x^6 + ... ------------------------------------------------------------ = g(x) = 1x^1 + 1x^2 + 2x^3 + 3x^4 + 5x^5 + 8x^6 + ... Hence, x = (1 - x - x^2) * g(x) g(x) = x / (1 - x - x^2)
- mek 13y agothis is amazingly beautiful.
- StevenXC 13y agoHere's the general formula: (copy everything between angle brackets) <http://texify.com/?$\frac{1}{10^n-m} http://texify.com/?$\frac{1}{10^n-m} = \sum_{i=0}^\infty \frac{m^i}{(10^n)^{i+1}}$> And here's OP's result where n=4 and m=2: http://www.wolframalpha.com/input/?i=%5Csum_%7Bi%3D0%7D%5E%5Cinfty+%5Cfrac%7B2%5Ei%7D%7B%2810%5E4%29%5E%7Bi%2B1%7D%7D http://www.wolframalpha.com/input/?i=%5Csum_%7Bi%3D0%7D%5E%5...
- PhilipTai 13y agoThe techniques of constructing such sequences have been studied formally in combinatorics under the name "generating function". http://en.wikipedia.org/wiki/Generating_function http://en.wikipedia.org/wiki/Generating_function In this case, the sequence 1, 2, 4, ..., 2^n has the generating function, g(z) = sum[i = 0 to inf] (2^i * z^i) = 1 + 2z + 4z^2 + ... = 1 / (1 - 2z) Substituting a small number 10^-k, such as z = 0.0001 gives 10000/9998, and then right shifting by dividing 10000 leads to 1/9998. What more interesting is that some other useful sequences can often be obtained from the function, by operations like differentiation and integration, or adding / multiplying with other functions. For example: 2z + (4*2)z^2 + (8*3)z^3 + (16*4)z^4 ... = d/dz(g(z)) = d/dz(z * 1 / (1 - 2z)) = 2 / (1 - 2z)^2 Put z = 1/10000 = 0.0001, this yields 50000000/24990001 = 2. 0008 0024 0064 0160 0384 ...
- rsiqueira 13y agoSince 1/9998 is a rational number, the result is a repeating decimal. The powers of 2 may sometime repeat its digits? According to according to WolframAlpha, 1/98 repeats after 42 digits. 1/998 repeats after 498 digits. And 1/9998 repeats each 357 digits.
- Russell91 13y agoUsing the sympygamma link also provided today, we can see why this is: http://www.sympygamma.com/input/?i=series%281%2Fx%2C+x%2C+10000%29 http://www.sympygamma.com/input/?i=series%281%2Fx%2C+x%2C+10... Look at the equation and then plug in (-2) for x
- mamcx 13y agoAnd this is usefull or simply neat?
- zyrthofar 13y agoWay back, I found out that there are an infinity of such patterns. I was really awed by that! http://blog.zyrthofar.com/2012/07/multiplying-recurring-decimals/ http://blog.zyrthofar.com/2012/07/multiplying-recurring-deci...
- dclara 13y agoYou are all genius. The first person found it is definitely outstanding. There are so much mathematic magic out there that always made me feel fascinating. I'm amazed by the nature of this world which can be described by math. It's unbelievable. So I made my logo utilizing one of it. http://bit.ly/1gre9Bh http://bit.ly/1gre9Bh
- raingrove 13y agoYou can just do 1/0.0001000200040008001600320064... to find it.
- aortega 13y agoYou don't need wolfram if you have unix's bc: echo "scale=10000;1/999999999999999999999999998" | bc
- deleted 13y ago[deleted]
- Aardwolf 13y agoIs anyone able to do this in hexadecimal? Wolfram Alpha interprets 1/0x9999998 or 1/0xffffffe correctly as hex input, but still shows the output as decimal approximation, while a hexadecimal approximation would be more useful here. I would be really curious what this thing looks like in other numeric bases. Unfortunately, the "Other base conversions" section only shows up to 7 or so digits after the point and doesn't allow expanding. EDIT: found it! I didn't know bc in linux was this awesome! echo "obase=16;ibase=16;scale=1000;1/FFFE" | bc .0001000200040008001000200040008001000200040008001000200040008001000 (....)
- sillaroja 13y agomaxima code follows fpprintprec:100; fpprec:100; s : string(bfloat(1)/bfloat(9998)); makelist(substring(s,3+4i,7+4i),i,0,15); [0002, 0004, 0008, 0016, 0032, 0064, 0128, 0256, 0512, 1024, 2048,4096, 8193,broken pattern,6387, 2774, 5549]
- sillaroja 13y agowith_bigfloat_precision(500) do BigInt(1)/BigInt(9998) end
- rsiqueira 13y agoI found other patterns! Powers of 3: 1/9997 = 0.0001 0003 0009 0027 0081 ... Powers of 4: 1/9996 = 0.0001 0004 0016 0064 0256 ... Powers of 5: 1/9995 = 0.0001 0005 0025 0125 0625 ... And so on...
- joefkelley 13y agoI just put up a blog post covering this and a number of other interesting decimal expansions: fibonacci: 100000000/99989999=1.000100020003000500080013002100340055... integers: 1000000/998001=1.002003004005006... square numbers: 1001000000/997002999=1.004009016025036... explanations and proofs at: http://www.joefkelley.com/?p=635 http://www.joefkelley.com/?p=635
- crawrey 13y agoHN just turned WolframAlpha into a porn site.
- fotoblur 13y agoAmazing but WTF does it mean? Are we living inside a simulation!
- asgard1024 13y agoAlso, 1/243 = 0.00411522633.. Source: Richard Feynman, "Surely you're joking, Mr. Feynman!"
- thomasahle 13y agoMaking new patterns is pretty easy. Just write use wolframalpha and write sum k^3*1000^(-k) for k=1 to infinity ( = 334667000/332001998667 = 0.001 008 027 064 125 216 343 512 730 ...) Also see if you can guess which one this is: 40920041/997002999 = 0.041 043 047 053 061 071 083 097 113 131 151 173 197 223 251 281 313 347 383 421... Mmmh. Primes.
- pszjmb 13y agoI'm a fan of 3^-n | n > 4. Apparently Richard Feynman (1997, p. 116) also was curious about the decimal expansion of 3^-5. Feynman, R. P. 'Surely You're Joking, Mr. Feynman!': Adventures of a Curious Character. New York: W. W. Norton, 1997.
- hajile 13y agoAn explanation http://www.youtube.com/watch?v=daro6K6mym8 http://www.youtube.com/watch?v=daro6K6mym8 If you wanted to extend this, make it something like 1/999999998 instead.