OFFSET
0,2
LINKS
Hajime Katsumoto, An Amazing Pattern involving Lucas Sequences, Crux Mathematicorum, Vol. 48(5), May 2022, pp. 279-280.
PROG
(PARI) a(n) = {if (n==0, return(1)); my(seqs=vector(n*(n+1)/2), k=0, all = List()); for (i=1, n, for (j=1, i, k++; seqs[k] = List([i, j]); listput(all, i); listput(all, j); ); ); while (1, my(s=seqs[#seqs], m = s[#s-1] + s[#s]); for (i=1, #seqs, my(ss = seqs[i], new); while((new = ss[#ss-1] + ss[#ss]) <= m, listput(seqs[i], new); listput(all, new); ss = seqs[i]); ); listsort(all, 1); my(vall = Vec(all), m=0); for (i=1, vecmax(vall), if (!vecsearch(vall, i), m = i; break); ); if (m && (m <= seqs[#seqs][#seqs[#seqs]]), return(m)); ); } \\ Michel Marcus, May 26 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, May 26 2022
STATUS
approved