login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014673 Smallest prime factor of greatest proper divisor of n. 17

%I #38 Jul 27 2019 00:40:23

%S 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,

%T 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,

%U 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

%N Smallest prime factor of greatest proper divisor of n.

%C For n > 1: a(n) = 1 iff n is prime; a(A001358(n)) = A084127(n); a(A025475(n)) = A020639(A025475(n)). [corrected by _Peter Munn_, Feb 19 2017]

%C When n is composite, this is the 2nd factor when n is written as a product of primes in nondecreasing order. For example, 12 = 2*2*3, so a(12) = 2. - _Peter Munn_, Feb 19 2017

%C For all sufficiently large n the median value of a(1), a(2), ... a(n) is A281889(2) = 7. - _Peter Munn_, Jul 12 2019

%H Antti Karttunen, <a href="/A014673/b014673.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A020639(A032742(n)).

%F A117357(n) = A020639(A054576(n)); A117358(n) = A032742(A054576(n)) = A054576(n)/A117357(n). - _Reinhard Zumkeller_, Mar 10 2006

%F If A001222(n) >= 2, a(n) = A027746(n,2), otherwise a(n) = 1. - _Peter Munn_, Jul 13 2019

%t 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} ]

%t (* Second program: *)

%t 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 *)

%o (PARI) lpf(n)=if(n>1,factor(n)[1,1],1)

%o a(n)=lpf(n/lpf(n)) \\ _Charles R Greathouse IV_, May 09 2013

%o (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

%o (Scheme) (define (A014673 n) (A020639 (/ n (A020639 n)))) ;; Code for A020639 given under that entry - _Antti Karttunen_, Aug 12 2017

%Y Cf. A001222, A001358, A020639, A025475, A027746, A032742, A054576, A084127, A085392, A085393, A115561, A117357, A117358, A281889.

%K nonn

%O 1,4

%A _Reinhard Zumkeller_, Jun 24 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)