4 ms·
The author's approximation of 125 million bangbangs in the 7th iteration is quite good. The actual number is: 159591041 I wrote a small Python script that all
by vog 13y ago
The author's approximation of 125 million bangbangs in the 7th iteration is quite good. The actual number is:
159591041
I wrote a small Python script that allows for further analysis outside the shell:
https://github.com/vog/bangbang https://github.com/vog/bangbang
- shadykiller 13y agoAwesome . .even I was close to 150 million but never the exact number anyway .. thanks for this
- shadykiller 13y agoDo you have the exact number for the 8th iteration ?
- vog 13y agoUnfortunately, no. The script actually calculates strings, then counts the bangbangs. The 7th iteration took about 4 GiB RAM (temporarily, and 2 GiB in the end). Using this approach, I don't think there's enough RAM for the 8th iteration on this planet. The algorithm would have to be optimized quite a lot before it could calculate the exact 8th value.
- vog 13y agoOkay, I finally found a way that gets us one more iteration. The exact next value is: 168668479408755201 Assuming your approximation "7 Quadrillion" means 7e15 (rather than 7e24 [1]), this is about 24 times as much. [1] http://en.wikipedia.org/wiki/Quadrillion http://en.wikipedia.org/wiki/Quadrillion
- shadykiller 13y agoI am still skeptical for this . . the basic approximation formula gives a ballpark .. and when I put 159 million in the formula it gives me 12640500079500000 which is 12 quadrillion ... http://www.tools4noobs.com/online_tools/number_spell_words/ http://www.tools4noobs.com/online_tools/number_spell_words/ Reason I say this is - let's assume all 159 million bangs are expanded then 159*159 millions = 25 quadrillion
- vog 13y agoSorry, this was a mistake. The correct number is: 16866847940875521 which is just 2.4 times as much as your approximation. It would be nice if somebody could confirm my numbers indepdently.
- shadykiller 13y agoYes . .16 quadrillion seems closer
- robinhouston 13y agoThe exact number for the 9th iteration is 189345699699803478502456213711361. Here is an algorithm for computing them efficiently: https://gist.github.com/robinhouston/6251775 https://gist.github.com/robinhouston/6251775
- dangirsh 13y agoThat's prime. Can someone figure out what's actually going on here? Prime numbers with that many digits shouldn't pop up by pure chance... I'm sure you all caught this, but the first 3 in the sequence are also prime.
- eblume 13y agoI'm too busy to check but I'd bet money that it's a Mersenne prime. The series looks exponential (like 2^n) and it's not hard to imagine that fenceposting (±1) led to each member in the series being (2^n)-1 - which is the form for Mersenne primes. Edit: Dang, I was wrong. ;)
- madaxe 13y agoNope. http://www.bigprimes.net/cruncher/159591041/ http://www.bigprimes.net/cruncher/159591041/ Don't take up gambling. ;)