login
a(1) = 1; a(n) = (largest prime factor of n) - 1.
11

%I #20 Jul 08 2018 19:57:16

%S 1,1,2,1,4,2,6,1,2,4,10,2,12,6,4,1,16,2,18,4,6,10,22,2,4,12,2,6,28,4,

%T 30,1,10,16,6,2,36,18,12,4,40,6,42,10,4,22,46,2,6,4,16,12,52,2,10,6,

%U 18,28,58,4,60,30,6,1,12,10,66,16,22,6,70,2,72,36,4,18,10,12,78,4,2,40,82,6

%N a(1) = 1; a(n) = (largest prime factor of n) - 1.

%C Also a(n) = Euler Phi of largest prime factor of n (previous name).

%C a(m*n) = max(a(m), a(n)). - _Robert Israel_, May 19 2015

%F a(n) = A000010(A006530(n)) = A006530(n) - 1 if n >= 2.

%e 102 = 2*3*17, so a(102) = 17 - 1 = 16.

%p with(numtheory): A070777 := n -> `if`(n=1,1,phi(max(op(factorset(n))))): # _Peter Luschny_, Oct 23 2010

%t a[n_] := EulerPhi[Last[FactorInteger[n]][[1]]]; Table[a[n], {n, 1, 200}] (* _José María Grau Ribas_, Feb 21 2010 *)

%o (PARI) a(n) = if (n==1, 1, vecmax(factor(n)[,1]) - 1); \\ after A006530; _Michel Marcus_, May 19 2015

%Y Cf. A000010, A006530, A068211, A070812.

%K easy,nonn

%O 1,3

%A _Labos Elemer_, May 07 2002

%E New name from _Michel Marcus_, May 19 2015