A126773 a(n) = largest divisor of n which is coprime to the largest proper divisor of n. (a(1)=1.).
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, 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, 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
Offset: 1
Keywords
Examples
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.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A126773 := proc(n) local p ; p := A020639(n) ; if modp(n,p^2) = 0 then 1 ; else p ; end if; end proc: seq(A126773(n),n=1..100) ; # R. J. Mathar, Mar 03 2017
-
Mathematica
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 *)
-
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
-
PARI
a(n) = if (n==1, 1, my(d = divisors(n)); denominator(d[#d-1]/d[2])); \\ Michel Marcus, Feb 27 2017
-
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
Formula
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.
Extensions
Extended by Ray Chandler, Feb 26 2007
Comments