r/dailyprogrammer • u/nottoobadguy • Feb 17 '12
[2/17/2012] Challenge #9 [difficult]
The U.S government has commissioned you to catch the terrorists!
There is a mathematical pyramid with the following pattern:
1
11
21
1211
111221
312211
you must write a program to calculate up to the 40th line of this pyramid. If you don't, the terrorists win!
3
Upvotes
View all comments
Show parent comment
2
u/Cosmologicon 2 3 Feb 17 '12
Oh well it's still got a lot of computation to do after it starts printing, obviously. I'm curious how long the computation takes.
How long to calculate, for instance, the 100 billionth digit of the 1000th line? No need to print out any digits before that.