OFFSET
1,4
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Divisor
Eric Weisstein's World of Mathematics, Permutation.
FORMULA
a(p) = p for primes p>3.
EXAMPLE
Divisor set of n=20: {1,2,4,5,10,20},
divisors occurring < 20: 1=a(1)=a(2)=a(3), 2=a(4)=a(6)=a(8), 4=a(16),
and as 4 occurs only once a(20)=4.
MAPLE
N:= 100:
V:= Vector(N):
for n from 1 to N do
Dn:= select(t -> V[t]<=2, numtheory:-divisors(n));
v:= min(Dn);
A[n]:= v; V[v]:= V[v]+1
od:
seq(A[i], i=1..N); # Robert Israel, Aug 01 2019
MATHEMATICA
nn = 100;
V = Table[0, {nn}];
For[n = 1, n <= nn, n++,
Dn = Select[Divisors[n], V[[#]] <= 2&];
v = Min[Dn];
a[n] = v; V[[v]] = V[[v]]+1];
Table[a[n], {n, 1, nn}] (* Jean-François Alcover, Dec 13 2021, after Robert Israel *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Jul 25 2003
STATUS
approved