Small bug in problem 67

Back to General discussions forum

Christopher Matthews     2015-11-05 16:11:04

Hello Rodion,

I was playing with long arithmetics in C, using problem 67 to practice. I noticed that with this input data,

22
110560307156090817237632754212345
572488245870673344662194682459267086009989015536025670856161416248139175446894290669084306226748539738437927821528
43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875
3865462327928467072415604609040860366007401579690263197296200323999931849
...

particularly the third number, has a Fibonacci index of 1000, according to this answer:

155 546 1000 349 991 994 49 563 365 555 56 829 625 83 291 830 32 399 712 619 354 761

The problem is, that the problem statement says that we are to find indices for the first 1000 Fibonacci numbers, which would have the upper bound as 999... but here we are searching the first 1001 values!

This is likely a very rare case, but I just wanted to let you know, lest somebody come across this and become confused.

-- Christopher P. Matthews

Rodion (admin)     2015-11-05 20:09:49
User avatar

Christopher, Hi!

Thanks a lot! I've checked the checker code and really it was buggy. Now it seems to me that I wrote it so poorly that it was very hard to notice this flaw. I suspect that people may have "segmentation fault" or other nasty things on such input data as their array do not have the index 1000... :)

BTW it looks you are going to become a polyglot of programming languages!

Please login and solve 5 problems to be able to post at forum