Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #18 Jun 09 2021 02:23:58
%S 1,1,1,1,1,1,16,24,70,31,98,112,116,170,216,488,2012,795,328,219,2993,
%T 4486,1555,814,3575,12296,18386,29659,13665,2162,47685,52346,69061,
%U 447927,472933,33798,857812,179171,47447,1195784,332172,618783,248092,3947618,2718980,15924182,2857983,3536883,8606700
%N Least index a(n) such that the sequences b(n,m) from A334539 are purely periodic after a(n).
%C By the pigeonhole principle, a(n) is upper bounded by n^n - n.
%H Elad Michael, <a href="/A335296/b335296.txt">Table of n, a(n) for n = 1..100</a>
%H Reddit user supermac30, <a href="https://www.reddit.com/r/math/comments/gdsjth/foggy_sequences/">Foggy Sequences</a>.
%e The sequence b(3, m) is 1, 1, 2, 1, 2, 2, 2, 3, 1, 1, 2, ... which is periodic at index 1 with period 8.
%e The sequence b(8, m) is 1, 1, 2, 1, 3, 1, 4, ... 3, 4, 1, 2, 3, 3, 4, 2, 2, 3, 3, 4, 2, 3, 3, 4, 2, 2, 3, 3, ... which is periodic at index 24 with period 9.
%o (Python)
%o def a(n):
%o b = [1];
%o for i in range(2,n+1):
%o b.append(b.count(b[-1]));
%o prev = {tuple(b):1};
%o m = 1;
%o while(True):
%o b.append(b.count(b[-1]));
%o del b[0];
%o m += 1;
%o if(tuple(b) in prev):
%o return prev[tuple(b)]
%o else:
%o prev[tuple(b)] = m;
%Y Cf. A334539.
%K nonn
%O 1,7
%A _Elad Michael_, May 30 2020