OFFSET
1,1
COMMENTS
Sándor calls this function the totient maximum function and remarks that this function is well-defined, since a(n) can be at least 2, and cannot be greater than n^2 (when n > 6).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
Max Alekseyev, PARI/GP Scripts for Miscellaneous Math Problems (invphi.gp).
József Sándor, On the Euler minimum and maximum functions, Notes on Number Theory and Discrete Mathematics, Volume 15, 2009, Number 3, Pages 1—8.
FORMULA
a(n) = Max_{d|n} A057635(d). - Antti Karttunen, Sep 09 2018
MATHEMATICA
a[n_] := Module[{kmax = If[n <= 6, 10 n, n^2]}, For[k = kmax, True, k--, If[Divisible[n, EulerPhi[k]], Return[k]]]];
Array[a, 80] (* Jean-François Alcover, Sep 17 2018, from PARI *)
PROG
(PARI) a(n) = {my(kmax = if (n<=6, 10*n, n^2)); forstep (k=kmax, 1, -1, if ((n % eulerphi(k)) == 0, return (k)); ); }
(PARI)
\\ (The first two functions could probably be combined in a smarter way):
A014197(n, m=1) = { n==1 && return(1+(m<2)); my(p, q); sumdiv(n, d, if( d>=m && isprime(d+1), sum( i=0, valuation(q=n\d, p=d+1), A014197(q\p^i, p))))} \\ From A014197 by M. F. Hasler
A057635(n) = if(1==n, 2, if((n%2), 0, my(k=A014197(n), i=n); if(!k, 0, while(k, i++; if(eulerphi(i)==n, k--)); (i))));
A319048(n) = { my(m=0); fordiv(n, d, m = max(m, A057635(d))); (m); }; \\ Antti Karttunen, Sep 09 2018
(PARI) a(n) = {my(d = divisors(n)); vecmax(vector(#d, i, invphiMax(d[i]))); } \\ Amiram Eldar, Nov 29 2024, using Max Alekseyev's invphi.gp
KEYWORD
nonn
AUTHOR
Michel Marcus, Sep 09 2018
STATUS
approved
