This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A306773 #16 Feb 22 2020 20:57:36 %S A306773 1,1,3,1,3,16,1,3,24,6,1,3,13,6,100,1,3,8,252,120,24,1,3,8,42,119,96, %T A306773 576,1,3,60,588,378,36,624,1932,1,3,126,600,144,381,200,936,912,1,3, %U A306773 480,51,9,2760,6220,540,1800,5700,1,3,170,750,2480,14880,10990,300,1440,3660,840,1,3,13800,5880,432,48096,60528,456,17640,8496,10560 %N A306773 Triangle read by rows, 0 <= k < n, n >= 2: T(n,k) is the eventual period of the modified Fibonacci sequence x(j) (or 0 if x(j) never enters a cycle) defined as follows: x(0) = 0, x(1) = 1, and for j > 1 x(j) is obtained from x(j-1) + x(j-2) by deleting all occurrences of the digit k in base n. %C A306773 For k = 1 x(j) = 0 for all j > 1, so T(n,1) = 1 for n >= 2. %C A306773 For k = 2 x(j) is the periodic sequence 0, 1, 1, 0, 1, 1, ... (A011655), so T(n,2) = 3 for n >= 3. %H A306773 Pontus von Brömssen, <a href="/A306773/b306773.txt">Rows n = 2..24, flattened</a> %e A306773 Triangle begins: %e A306773 n\k 0 1 2 3 4 5 6 7 8 9 10 11 %e A306773 --------------------------------------------------------------------------- %e A306773 2: 1 1 %e A306773 3: 3 1 3 %e A306773 4: 16 1 3 24 %e A306773 5: 6 1 3 13 6 %e A306773 6: 100 1 3 8 252 120 %e A306773 7: 24 1 3 8 42 119 96 %e A306773 8: 576 1 3 60 588 378 36 624 %e A306773 9: 1932 1 3 126 600 144 381 200 936 %e A306773 10: 912 1 3 480 51 9 2760 6220 540 1800 %e A306773 11: 5700 1 3 170 750 2480 14880 10990 300 1440 3660 %e A306773 12: 840 1 3 13800 5880 432 48096 60528 456 17640 8496 10560 %e A306773 T(10,0) = 912 because A243063 eventually enters a cycle of length 912. %o A306773 (PARI) isok(v) = {for (n=1, #v-2, if ((v[#v] == v[#v - n]) && (v[#v-1] == v[#v - n - 1]), return (n));); 0;} %o A306773 f(x, y, n, k) = {my(z=x+y, d = digits(z, n)); fromdigits(select(t->(t!=k), d), n);} %o A306773 T(n,k) = {my(v = [0, 1], len = 2); while (! (per = isok(v)), v = concat(v, f(v[len-1], v[len], n, k)); len++;); per;} \\ _Michel Marcus_, May 01 2019 %o A306773 (Python) %o A306773 # Note: the function hangs if the sequence never enters a cycle. %o A306773 import functools,sympy %o A306773 def drop(x,n,k): return functools.reduce(lambda x,j:n*x+j if j!=k else x,sympy.ntheory.factor_.digits(x,n)[1:],0) # Drop all digits k from x in base n. %o A306773 def A306773(n,k): return next(sympy.cycle_length(lambda x:(x[1],drop(x[0]+x[1],n,k)),(0,1)))[0] %o A306773 # _Pontus von Brömssen_, May 09 2019 %Y A306773 Cf. A011655, A243063. %K A306773 nonn,base,tabf %O A306773 2,3 %A A306773 _Pontus von Brömssen_, Mar 09 2019