%I #16 Feb 25 2023 03:05:41
%S 1,1,6,9,4,11,110,93,86,130,11,1638,229,3056,268,1510,10118,11477,727,
%T 17711,83295,59861,22334,19659,301848,977089,59943,414086,536681,
%U 649382
%N First appearance of the Fibonacci numbers in the decimals of Pi.
%e Fibonacci(4) is 3, 3 appears for the first time in decimals of Pi in position 9, so a(4) = 9.
%t (* Determine the decimal digits of Pi following the decimal point. *)
%t decimalPiDigits[n_] := First@RealDigits[Pi, 10, n, -1];
%t (* Find the position of first occurrence of 'sublist' in 'list', or Indeterminate if it doesn't occur. *)
%t firstPosition[sublist_, list_] :=
%t With[{p = SequencePosition[list, sublist]},
%t If[Length[p] == 0, Indeterminate, First@First@p]];
%t (* Find the first occurrence of the given digits in the decimal digits of Pi by calculating ever more digits of Pi, as needed. *)
%t findDigitSequenceInDecimalPiDigits[seq_] :=
%t First@NestWhile[
%t With[
%t {
%t numdigits = Max[1, 2*Last[#]] (*
%t How many digits will we calculate in this iteration? *)
%t },
%t {firstPosition[seq, decimalPiDigits[numdigits]], numdigits}
%t ] &,
%t {Indeterminate, 0},
%t Not@*IntegerQ@*First
%t ];
%t (* Find the first 30 entries. *)
%t Table[findDigitSequenceInDecimalPiDigits[
%t IntegerDigits@Fibonacci[n]], {n, 1, 30}]
%t (* _Sidney Cadot_, Feb 25 2023 *)
%Y Cf. A000045, A000796.
%K nonn,base,more
%O 1,3
%A _Vicente Izquierdo Gomez_, Sep 11 2012
|