Infinite Bang Bang
shadabahmed.com
shadabahmed.com
159591041
I wrote a small Python script that allows for further analysis outside the shell:
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.
168668479408755201
Assuming your approximation "7 Quadrillion" means 7e15 (rather than 7e24 [1]), this is about 24 times as much.
Reason I say this is - let's assume all 159 million bangs are expanded then 159*159 millions = 25 quadrillion
16866847940875521
which is just 2.4 times as much as your approximation.
It would be nice if somebody could confirm my numbers indepdently.
Here is an algorithm for computing them efficiently: https://gist.github.com/robinhouston/6251775
I'm sure you all caught this, but the first 3 in the sequence are also prime.
Edit: Dang, I was wrong. ;)
http://www.bigprimes.net/cruncher/159591041/
Don't take up gambling. ;)
I noticed that different patterns emerge when you subtract 1 from each value in the sequence. From there we get:
0
1
2
4
16
160
15680
159591040
16866847940875520
Each (excluding 0 and 1) is a multiple of the previous term:
1
2 = 1 * 2
4 = 2 * 2
16 = 4 * 4
160 = 16 * 10
15680 = 160 * 98
159591040 = 15680 * 10178
16866847940875520 = 159591040 * 105687938
Anything ring a bell? Notice any other patterns?
2 - 2 = 0
2 - 2 = 0
4 - 2 = 2
10 - 2 = 8 = 2 * 4
98 - 2 = 96 = 8 * 12
10178 - 2 = 10176 = 96 * 106
105687938 - 2 = 105687936 = 10176 * 10386
https://news.ycombinator.com/item?id=6227115
Newly registered OEIS sequence:
~ !!
fish: Unknown command “!!”Mostly because !! is right there and Up+Home are over there.
!! is pointless because up arrow, come on.
Also it's up, home, "sudo "
Ctrl-a/Ctrl-e are equivalent to Home/End (unless you're inside a screen session, which was a terrible choice of binding on their part).
You can set them to the vi ones instead with:
set -o vi
..and they do work with screen ;-) (0 for start, $ for end)in my screenrc changes this to 'CTRL+spacebar', which I find much more sensible.
:(){ :|:& };:
Don't run that on a shell unless you enjoy having to physically reboot servers.