What is the smallest positive integer N, such that the base ten representation of Nth Fibonacci number ends in six zeroes?
clearvars,clc
set=[1 1 2]; n=1;
while set(1)~=0;
set=[set(2) set(3) mod(set(2)+set(3),1000000)];
n=n+1;
end
n
f=char(string(fibonacci(sym(n))));
for i=1:length(f)-40
if 40*i>length(f)
disp(f(40*i-39:end))
else
disp(f(40*i-39:40*i))
end
end
finds the 750,000th Fibonacci number, with 156,741 digits.
2402716229410201645096092466006718783166
3711242491399455875225642564446715449904
9712132216374249351089481167944075661496
5447418753985018769082434554471136887558
2616141939034330088157690986844830623861
. . .
4212845780486847231691796660745346409824
9156074871101754360333160707140663811587
2853580334603735159021026539182339027198
6800206858618678091581677244279830687940
7874650195459262826537884989454974328579
6527126182261687456230868950890649393487
3476663145019975519952753065737035467582
3801287923759984886920441523473972056645
713853084177449000000
>>
|
Posted by Charlie
on 2023-11-08 09:06:56 |