You might have heard of the Fibonacci numbers and of the number pi.
If you let these two ideas merge, a new and esoteric concept comes into being:
the Pibonacci numbers. These can be defined for real x >= 0 by:
P(x) = 1 for 0 <= x < 4
P(x) = P(x - 1) + P(x - pi) for x >= 4,
where pi = 3.1415926535... In this problem, you are asked to compute P(x) for a given x,
where x is a non-negative integer number (less than 30000).
Hints:
P(0) = 1
P(4) = 2
P(10) = 14
P(11) = 20
P(100) = 5338198515572716
P(10000) =
30545061766548826347723622438005598334547039374992
90113008199964715857981506903607585689770339053086
23582036970173222028695034160773457277489005548434
17020796291845338949687167603974595558347137121217
94967248559855843389551994870458311313312344050309
26953096233856792547217501033692773439422753706749
75787164384879377786735733077303986883046271278570
21201893525701528659063857187966332441184716237226
69326907300731819842942377628687148684970555383475
59934470505111156957972054431125340438368447868289
62291699146142605916313354358025513818642587234401
29221003159635553765229982268111989465247965530579
11455875848567970805369891745228832920941822856078
71837646059510451089216388517941864454024561344107
87338437660695880294107196594263246220666104829574
17308001324200284988508657339845510890573271727796
85014714292928424032536221127315507955108814140393
81098371314381088699431874240026717000932753775313
09851253295038144278739276090483044831966040316689
77605611576202999395210908046726682599785866106081
25086280732687524214522573222031212086354074164955
96961873718206154505873516193044667895322796150306
05267341100116655225123834641245441248980916942413
26205649996121608255109099308055932633784720918028
64438756163075739226587263206887350265551536945610
37013044605514190168453868193943302408320903816087
56718108514024423395755370256937230041005874987898
52381791671318491462930261787039199555019880263789
23751491521989840810768222435642807253020761248276
33075558810802435250802095650410899109886849531218
27273903819599408284858157102491364090281856443316
14100508402747147674473055900552596251489724880320
7988426623314191
P(29999) = ???
P.S.
It's a problem from IPSC 2001.