A014673 Smallest prime factor of greatest proper divisor of n.
1, 1, 1, 2, 1, 3, 1, 2, 3, 5, 1, 2, 1, 7, 5, 2, 1, 3, 1, 2, 7, 11, 1, 2, 5, 13, 3, 2, 1, 3, 1, 2, 11, 17, 7, 2, 1, 19, 13, 2, 1, 3, 1, 2, 3, 23, 1, 2, 7, 5, 17, 2, 1, 3, 11, 2, 19, 29, 1, 2, 1, 31, 3, 2, 13, 3, 1, 2, 23, 5, 1, 2, 1, 37, 5, 2, 11, 3, 1, 2, 3, 41, 1, 2, 17, 43, 29, 2, 1, 3, 13, 2, 31, 47
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
PrimeFactors[ n_ ] := Flatten[ Table[ # [ [ 1 ] ], {1} ] & /@ FactorInteger[ n ] ]; f[ n_ ] := Block[ {gpd = Divisors[ n ][ [ -2 ] ]}, If[ gpd == 1, 1, PrimeFactors[ gpd ][ [ 1 ] ] ] ]; Table[ If[ n == 1, 1, f[ n ] ], {n, 1, 95} ] (* Second program: *) Table[If[Or[PrimeQ@ n, n == 1], 1, FactorInteger[n/SelectFirst[Prime@ Range@ PrimePi[Sqrt@ n], Divisible[n, #] &]][[1, 1]] ], {n, 94}] (* Michael De Vlieger, Aug 14 2017 *)
-
PARI
lpf(n)=if(n>1,factor(n)[1,1],1) a(n)=lpf(n/lpf(n)) \\ Charles R Greathouse IV, May 09 2013
-
PARI
a(n)=if(n<4||isprime(n),return(1)); my(f=factor(n)); if(f[1,2]>1, f[1,1], f[2,1]) \\ Charles R Greathouse IV, May 09 2013
-
Scheme
(define (A014673 n) (A020639 (/ n (A020639 n)))) ;; Code for A020639 given under that entry - Antti Karttunen, Aug 12 2017
Comments