%I #6 Mar 04 2023 18:40:05
%S 1,2,3,2,5,3,7,4,3,5,11,4,13,7,5,8,17,6,19,5,7,11,23,6,5,13,9,7,29,6,
%T 31,8,11,17,7,9,37,19,13,8,41,7,43,11,9,23,47,8,7,10,17,13,53,18,11,
%U 14,19,29,59,10,61,31,21,16,13,11,67,17,23,10,71,12,73,37,15,19,11,13,79,10
%N a(n) = smallest divisor d of n that occurs earlier in the sequence fewer than a(d) times.
%C When n is prime, no smaller divisor is available, so a(n) = n. It can be shown than a(n) < n if n is composite. Similar to Golomb's sequence (A001462), but with the added condition that a(n) divides n.
%H John Tyler Rascoe, <a href="/A116548/b116548.txt">Table of n, a(n) for n = 1..10000</a>
%o (Python)
%o from sympy import divisors
%o def A(maxn):
%o A = []
%o for n in range(1,maxn+1):
%o d = divisors(n)
%o for j in range(0,len(d)):
%o if d[j] > len(A): break
%o if A.count(d[j]) < A[d[j]-1]: break
%o A.append(d[j])
%o return(A) # _John Tyler Rascoe_, Mar 04 2023
%Y Cf. A095163, A001462.
%K nonn
%O 1,2
%A _Franklin T. Adams-Watters_, Mar 16 2006