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!)
A126773 a(n) = largest divisor of n which is coprime to the largest proper divisor of n. (a(1)=1.). 5

%I #12 Mar 03 2017 04:07:59

%S 1,2,3,1,5,2,7,1,1,2,11,1,13,2,3,1,17,2,19,1,3,2,23,1,1,2,1,1,29,2,31,

%T 1,3,2,5,1,37,2,3,1,41,2,43,1,1,2,47,1,1,2,3,1,53,2,5,1,3,2,59,1,61,2,

%U 1,1,5,2,67,1,3,2,71,1,73,2,3,1,7,2,79,1,1,2,83,1,5,2,3,1,89,2,7,1,3,2,5,1

%N a(n) = largest divisor of n which is coprime to the largest proper divisor of n. (a(1)=1.).

%C Also the denominator of the ratio of the largest proper divisor to the least prime divisor of n, which can be thought of as the ratio of the 2nd largest divisor to the 2nd least divisor of n. - _Michel Marcus_, Feb 27 2017

%H Charles R Greathouse IV, <a href="/A126773/b126773.txt">Table of n, a(n) for n = 1..10000</a>

%F For n >= 2: Let p =A020639(n) be the smallest prime dividing n. If p^2 divides n, then a(n)=1. Otherwise, a(n) = p.

%e The largest proper divisor of 30 is A032742(30) = 15. So a(30)= 2, because 2 is the largest divisor of 30 which is coprime to 15.

%p A126773 := proc(n)

%p local p ;

%p p := A020639(n) ;

%p if modp(n,p^2) = 0 then

%p 1 ;

%p else

%p p ;

%p end if;

%p end proc:

%p seq(A126773(n),n=1..100) ; # _R. J. Mathar_, Mar 03 2017

%t f[n_] := Block[{d = Divisors[n]},If[n < 2, 1, Max @@ Select[d, GCD[ #, d[[ -2]]] == 1 &]]];Array[f, 100] (* _Ray Chandler_, Feb 26 2007 *)

%o (PARI) a(n) = if (n==1, 1, my(d = divisors(n)); k = #d; while (gcd(d[k], d[#d-1]) != 1, k--); d[k]); \\ _Michel Marcus_, Feb 27 2017

%o (PARI) a(n) = if (n==1, 1, my(d = divisors(n)); denominator(d[#d-1]/d[2])); \\ _Michel Marcus_, Feb 27 2017

%o (PARI) a(n)=if(n==1, return(1)); my(f=factor(n)[1,]); if(f[2]>1, 1, f[1]) \\ _Charles R Greathouse IV_, Feb 27 2017

%K nonn

%O 1,2

%A _Leroy Quet_, Feb 17 2007

%E Extended by _Ray Chandler_, Feb 26 2007

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 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)