First power of 2 that has leading decimal digits of 12: Difference between revisions

Content added Content deleted
(added header pascal no use of something like gmp.)
m (→‎{{header|Pascal}}: removed part after end.)
Line 183: Line 183:
FindExp(12345,123);
FindExp(12345,123);
FindExp(678910,123);
FindExp(678910,123);
end.

cnt := 0;
CntLmt := 678910-10;
for i := 1 to 193060223 do
Begin
x:= 100*exp(ln(10)*frac(i*lD10));
IF trunc(x) = 123 then
Begin
inc(cnt);
IF cnt>= CntLmt then
writeln(cnt:8,i:10,trunc(x):5)
end;
end;
end.</lang>
end.</lang>
{{out}}
{{out}}