A307069 Given a special version of Pascal's triangle where only Fibonacci numbers are permitted, a(n) is the row number in which the n-th Fibonacci number first appears.
0, 0, 2, 3, 9, 50, 51, 70, 71, 133, 134, 135, 136, 2543, 2544
Offset: 1
Links
- David A. Corneth, PARI program
Programs
-
Mathematica
Block[{s = Array[Fibonacci, 20], t}, t = Nest[Append[#1, (PadLeft[#1[[-1]], #2] + PadRight[#1[[-1]], #2]) /. k_Integer /; FreeQ[s, k] -> 1] & @@ {#, Length@ # + 1} &, {{1}}, 10^4]; -1 + TakeWhile[Map[FirstPosition[t, #][[1]] &, s], IntegerQ]] (* Michael De Vlieger, Mar 24 2019 *)
-
PARI
isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8)); lista(nn) = {print1(0, ", ", 0, ", "); v = [1,1]; nextf = 3; for (n=2, nn, w = vector(n+1); w[1] = v[1]; for (j=2, n, w[j] = v[j-1]+ v[j]; if (!isfib(w[j]), w[j] = 1)); w[n+1] = v[n]; sw = vecsort(w,,8); if (vecsearch(sw, fibonacci(nextf)), print1(n, ", "); nextf++); v = w;);} \\ Michel Marcus, Mar 22 2019
-
PARI
See Corneth link \\ David A. Corneth, Mar 25 2019
Extensions
a(14)-a(15) from Michel Marcus, Mar 22 2019
Comments