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 A326791 #10 Oct 21 2019 19:29:18 %S A326791 1,39,23,5,10,9,31,8,8,8,7,8,7,9,10,29,9,38,36,13,14,13,8,12,40,19,11, %T A326791 25,10,15,13,18,11,5,39,36,40,37,12,25,11,12,29,30,33,25,32,5,40,25, %U A326791 12,25,11,21,40,27,18,19,17,9,41,18,11,5,41,37,40,12,29 %N A326791 For n > 1, let f_n be the lexicographically earliest sequence of distinct positive terms such that f_n(1) = 1, f_n(2) = n, and for k > 2, f_n(k) divides f_n(k-2) + f_n(k-1); if f_n is finite, then a(n) is the number of terms of f_n, otherwise a(n) = -1; a(1) = 1. %C A326791 Apparently, f_n is finite for any n > 0. %C A326791 The first records are: %C A326791 n a(n) %C A326791 ------- ---- %C A326791 1 1 %C A326791 2 39 %C A326791 25 40 %C A326791 61 41 %C A326791 78 45 %C A326791 266 47 %C A326791 279 56 %C A326791 629 102 %C A326791 95417 103 %C A326791 331468 104 %C A326791 1318090 108 %C A326791 5383290 109 %H A326791 Rémy Sigrist, <a href="/A326791/a326791.gp.txt">PARI program for A326791</a> %e A326791 For n = 2: %e A326791 - f_2 corresponds to A085947 which is finite with 39 terms, %e A326791 - hence a(2) = 39. %o A326791 (PARI) See Links section. %Y A326791 Cf. A085947. %K A326791 nonn %O A326791 1,2 %A A326791 _Rémy Sigrist_, Oct 19 2019