%I #16 Feb 27 2017 11:11:16
%S 3,4,7,4,7,7,7,6,7,6,7,7,7,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,
%T 8,8,8,8,8,8,8
%N a(n) is the maximum number of "describing"-steps for an n-chain before entering a loop.
%C Conjecture: The size of terms of this sequence is unbounded (cf. Marichal, 2007, Corollary 5).
%H Jean-Luc Marichal, <a href="https://arxiv.org/abs/0708.1491">On perfect, amicable, and sociable chains</a>, arXiv:0708.1491 [math.CO], 2007.
%o (PARI)
%o pad(d, n) = while(#d != n, d = concat([0], d)); d;
%o say(d, n) = vector(n, k, sum(j=1, #d, d[j] == (k-1)));
%o isok(v, n) = my(vs = vecsort(v,,8)); (#vs > 1) && (#vs <n);
%o vsearch(v, x) = for (i=1, #v, if (v[i] == x, return (i)););
%o a(n) = {nmax = 0; for (i=0, n^n-1, d = digits(i, n); d = pad(d, n); circuit = [i]; pos = 0; if (isok(d, n), while (! pos, sd = say(d, n); if (! isok(sd, n), break); isd = fromdigits(sd, n); pos = vsearch(circuit, isd); if (! pos, circuit = concat(isd, circuit); d = sd, start = #circuit - pos; nmax = max(nmax, start); );););); nmax;} \\ _Michel Marcus_, Feb 25 2017
%Y Cf. A046043, A108551.
%K nonn,more
%O 4,1
%A _Felix Fröhlich_, Feb 17 2017
%E Name edited by _Michel Marcus_, Feb 26 2017