login
Greatest common divisor of the proper divisors of n, 0 if there are none.
6

%I #25 Jan 31 2025 06:22:19

%S 0,0,0,2,0,1,0,2,3,1,0,1,0,1,1,2,0,1,0,1,1,1,0,1,5,1,3,1,0,1,0,2,1,1,

%T 1,1,0,1,1,1,0,1,0,1,1,1,0,1,7,1,1,1,0,1,1,1,1,1,0,1,0,1,1,2,1,1,0,1,

%U 1,1,0,1,0,1,1,1,1,1,0,1,3,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,1

%N Greatest common divisor of the proper divisors of n, 0 if there are none.

%C Here a proper divisor d of n is a divisor of n such that 1 < d < n.

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

%F a(n) = 0 if n is not composite, p if n is a proper power of prime p, and 1 otherwise. - _Franklin T. Adams-Watters_, Mar 22 2011

%F Conjecture: Sum_{k=1..n} a(k) = A072107(n) - A034387(n) - 1. - _Vaclav Kotesovec_, Jan 29 2025

%F From _Peter Luschny_, Jan 31 2025: (Start)

%F a(n) = A014963(n) - A061397(n) for n > 1. In other words, this sequence is the exponential von Mangoldt function restricted to proper divisors of n. See A380118. This implies the above conjecture.

%F a(n) = A020500(n) - A061397(n). (End)

%p A182936 := n -> igcd(op(numtheory[divisors](n) minus {1,n}));

%p seq(A182936(i), i=1..79); # _Peter Luschny_, Mar 22 2011

%t Join[{0}, Table[GCD@@Most[Rest[Divisors[n]]],{n,2,110}]] (* _Harvey P. Dale_, May 04 2018 *)

%t (* From _Peter Luschny_, Jan 31 2025: (Start) *)

%t Join[{0}, Table[Exp[MangoldtLambda[n]] - If[PrimeQ[n], n, 0], {n,2,110}]]

%t (* or *)

%t Table[Cyclotomic[n, 1] - If[PrimeQ[n], n, 0], {n,1,110}] (* End *)

%o (PARI) A182936(n) = { my(divs=divisors(n)); if(#divs<3,0,gcd(vector(numdiv(n)-2,k,divs[k+1]))); }; \\ _Antti Karttunen_, Sep 23 2017

%Y Cf. A014963, A020500, A048671, A034387, A061397, A072107, A380118.

%K nonn

%O 1,4

%A _Peter Luschny_, Mar 22 2011

%E More terms from _Antti Karttunen_, Sep 23 2017