login
Third-smallest divisor of n-th composite number.
1

%I #19 Nov 17 2022 08:48:24

%S 4,3,4,9,5,3,7,5,4,3,4,7,11,3,25,13,9,4,3,4,11,17,7,3,19,13,4,3,4,5,

%T 23,3,49,5,17,4,3,11,4,19,29,3,31,7,4,13,3,4,23,5,3,37,5,4,11,3,4,9,

%U 41,3,17,43,29,4,3,13,4,31,47,19,3,7,9,4,3,4,5,53

%N Third-smallest divisor of n-th composite number.

%C The terms are either primes or squares of primes.

%t f[n_] := Divisors[n][[3]]; f /@ Select[Range[100], CompositeQ] (* _Amiram Eldar_, Jan 20 2021 *)

%o (PARI) lista(nn)=my(list = List()); forcomposite(n=1, nn, listput(list, divisors(n)[3]);); Vec(list); \\ _Michel Marcus_, Jan 20 2021

%o (PARI) do(lim)=my(v=List()); forfactored(n=4,lim\1, my(f=n[2]); if(#f~==1, if(f[1,2]>1, listput(v,f[1,1]^2)), listput(v, if(f[1,2]>1, min(f[1,1]^2,f[2,1]), f[2,1])))); Vec(v) \\ _Charles R Greathouse IV_, Nov 17 2022

%o (Python)

%o from sympy import divisors, composite

%o def A340768(n):

%o return divisors(composite(n))[2] # _Chai Wah Wu_, Jan 21 2021

%Y Cf. A020639, A000290, A000040, A002808, A001248, A000430.

%K nonn,easy

%O 1,1

%A _Charles Kusniec_, Jan 20 2021