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 A086956 #17 Feb 16 2025 08:32:50 %S A086956 1,1,1,2,5,2,7,2,3,5,11,3,13,7,3,4,17,6,19,4,7,11,23,4,5,13,9,14,29,6, %T A086956 31,8,11,17,35,6,37,19,13,8,41,14,43,22,9,23,47,8,49,10,17,26,53,9,55, %U A086956 14,19,29,59,10,61,31,21,16,65,22,67,34,23,10,71,12,73,37,15,38 %N A086956 a(1)=1, for n>1: a(n) is the smallest divisor of n occurring earlier at most twice. %C A086956 For all natural numbers m there exist exactly three numbers u(m) < v(m) < w(m) with m=a(u(m))=a(v(m))=a(w(m)) (see A086957=u, A086958=v, A086959=w). %C A086956 Permuting {u,v,w} induces 6=3! permutations of natural numbers: [(2,3,1)]->A086960, [(3,2,1)]->A086961, [(1)(2,3)]->A086962, [(2)(3,1)]->A086963, [(3)(2,1)]->A086964 and [(1,2,3)]->A000027. %H A086956 Robert Israel, <a href="/A086956/b086956.txt">Table of n, a(n) for n = 1..10000</a> %H A086956 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Divisor.html">Divisor</a> %H A086956 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Permutation.html">Permutation.</a> %F A086956 a(p) = p for primes p>3. %e A086956 Divisor set of n=20: {1,2,4,5,10,20}, %e A086956 divisors occurring < 20: 1=a(1)=a(2)=a(3), 2=a(4)=a(6)=a(8), 4=a(16), %e A086956 and as 4 occurs only once a(20)=4. %p A086956 N:= 100: %p A086956 V:= Vector(N): %p A086956 for n from 1 to N do %p A086956 Dn:= select(t -> V[t]<=2,numtheory:-divisors(n)); %p A086956 v:= min(Dn); %p A086956 A[n]:= v; V[v]:= V[v]+1 %p A086956 od: %p A086956 seq(A[i],i=1..N); # _Robert Israel_, Aug 01 2019 %t A086956 nn = 100; %t A086956 V = Table[0, {nn}]; %t A086956 For[n = 1, n <= nn, n++, %t A086956 Dn = Select[Divisors[n], V[[#]] <= 2&]; %t A086956 v = Min[Dn]; %t A086956 a[n] = v; V[[v]] = V[[v]]+1]; %t A086956 Table[a[n], {n, 1, nn}] (* _Jean-François Alcover_, Dec 13 2021, after _Robert Israel_ *) %Y A086956 Cf. A086571, A086572. %Y A086956 Cf. A086957, A086958, A086959. %Y A086956 Cf. A086960, A086961, A086962, A086963. %K A086956 nonn,look %O A086956 1,4 %A A086956 _Reinhard Zumkeller_, Jul 25 2003