Skip to main content
3 of 7
added 26 characters in body

bash + Unix utilities, 45 bytes (47-2)

dc -e9k0d5v1+2/r^5v/.5+0k1/p;sed -i s/r/r1+/ $0

The first time this is run, it uses dc to compute the 0th Fibonacci number via the Binet formula. Each call to sed modifies the program by changing the string passed to dc; this change tells dc to add an additional 1 to the exponent in the formula, which causes it to compute the next number in the Fibonacci sequence each time.