A086956 a(1)=1, for n>1: a(n) is the smallest divisor of n occurring earlier at most twice.
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, 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, 14, 19, 29, 59, 10, 61, 31, 21, 16, 65, 22, 67, 34, 23, 10, 71, 12, 73, 37, 15, 38
Offset: 1
Examples
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.
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.
Crossrefs
Programs
-
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 *)
Formula
a(p) = p for primes p>3.
Comments