cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A057635 a(n) is the largest m such that phi(m) = n, where phi is Euler's totient function = A000010, or a(n) = 0 if no such m exists.

Original entry on oeis.org

2, 6, 0, 12, 0, 18, 0, 30, 0, 22, 0, 42, 0, 0, 0, 60, 0, 54, 0, 66, 0, 46, 0, 90, 0, 0, 0, 58, 0, 62, 0, 120, 0, 0, 0, 126, 0, 0, 0, 150, 0, 98, 0, 138, 0, 94, 0, 210, 0, 0, 0, 106, 0, 162, 0, 174, 0, 118, 0, 198, 0, 0, 0, 240, 0, 134, 0, 0, 0, 142, 0, 270, 0, 0, 0, 0, 0, 158, 0, 330, 0
Offset: 1

Views

Author

Jud McCranie, Oct 10 2000

Keywords

Comments

To check that a property P holds for all EulerPhi(x) not exceeding n, for n with a(n) > 0, it suffices to check P for all EulerPhi(x) with x not exceeding a(n). - Joseph L. Pe, Jan 10 2002
The Alekseyev link in A131883 establishes the following explicit relationship between A131883, A036912 and A057635: for t belonging to A036912, we have t = A131883(A057635(t)-1). In other words, A036912(n) = A131883(A057635(A036912(n))-1) for all n.
From Jianing Song, Feb 16 2019: (Start)
Let f(n) = exp(gamma)*log(log(n)) + 2.5/log(log(n)), then a(n) < n*f(n^2) for all n > 1, where gamma = A001620.
Proof. Without loss of generality we suppose log(log(n)) > n_0 = sqrt(2.5/exp(gamma)) = 1.18475..., then f(n), n/f(n) and N(n) = ceiling(n*f(n^2)) are all monotonically increasing functions of n, and we have f(n) < 2*exp(gamma)*log(log(n)).
By the formula (3.41) in Theorem 15 by J. Barkley Rosser and Lowell Schoenfeld we have phi(k) > k/f(k) for k != 1, 2, 223092870. N(31802157) = 223092869 < 223092870, N(31802158) = 223092877 > 223092870, so N(n) != 223092870 (N(n) is increasing). So phi(N(n)) > N(n)/f(N(n)) > (n*f(n^2))/f(n*f(n^2)) (n/f(n) is increasing and log(log(n*f(n^2))) > n_0).
Note that f(n^2) < 2*exp(gamma)*log(log(n^2)) < 2*exp(gamma)*(log(n^2)/e) = 4*exp(gamma-1)*log(n) < 4*exp(gamma-2)*n < n, so n*f(n^2) < n^2, f(n*f(n^2)) < f(n^2) (f(n) is increasing and log(log(n*f(n^2))) > n_0), so phi(N(n)) > n. As a result, a(n) <= N(n) - 1 < n*f(n^2).
Conjecturally a(n) < n*f(n) for all n > 2. (End)

Examples

			m = 12 is the largest value of m such that phi(m) = 4, so a(4) = 12.
		

Crossrefs

Cf. A006511 (largest k for which A000010(k) = A002202(n)).

Programs

  • Mathematica
    a = Table[0, {100}]; Do[ t = EulerPhi[n]; If[t < 101, a[[t]] = n], {n, 1, 10^6}]; a
  • PARI
    a(n) = if(n%2, 2*(n==1), forstep(k=floor(exp(Euler)*n*log(log(n^2))+2.5*n/log(log(n^2))), n, -1, if(eulerphi(k)==n, return(k)); if(k==n, return(0)))) \\ Jianing Song, Feb 15 2019
    
  • PARI
    apply( {A057635(n,m=istotient(n))=if(!m, 0, n>1, m=log(log(n)*2); m=bitand(n*(exp(Euler)*m+2.5/m)\1,-2); while(eulerphi(m)!=n, m-=2); m, 2)}, [1..99]) \\ If n is known to be a totient, a nonzero 2nd arg can be given to avoid the check. - M. F. Hasler, Aug 13 2021
    
  • PARI
    a(n) = invphiMax(n); \\ Amiram Eldar, Nov 14 2024 using Max Alekseyev's invphi.gp

Formula

a(2n+1) = 0 for n > 0, and a(2n) = 0 iff 2n is in A005277.

Extensions

Edited and escape clause added to definition by M. F. Hasler, Aug 13 2021

A036912 Indices of the left-to-right maxima in A057635.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 36, 40, 48, 64, 72, 80, 96, 120, 128, 144, 160, 176, 192, 224, 240, 288, 320, 336, 384, 432, 480, 576, 672, 720, 768, 864, 960, 1056, 1152, 1280, 1296, 1344, 1440, 1536, 1680, 1728, 1920, 2112, 2208, 2304, 2400, 2592, 2688
Offset: 1

Views

Author

Keywords

Comments

A number m belongs to this sequence iff A057635(k) < A057635(m) for all k
Indices of records in A057635(n), the maximal m with phi(m)=n.
The Alekseyev link in A131883 establishes the following explicit relationship between A131883, A036912 and A057635. Namely, for t belonging to A036912, we have t=A131883(A057635(t)-1). In other words, A036912(n) = A131883(A057635(A036912(n))-1) for all n.

Programs

  • Mathematica
    Block[{nn = 10^6, s, t, u}, s = PositionIndex@ Array[EulerPhi, nn]; t = ConstantArray[0, nn]; u = Take[ReplacePart[t, Map[# -> Last@ Lookup[s, #] &, Keys@ s]], 10^(Log10[nn] - 2)]; Map[FirstPosition[u, #][[1]] &, Union@ FoldList[Max, u]]] (* Michael De Vlieger, Oct 24 2017 *)

Formula

a(n) = A000010(A036913(n)). - Max Alekseyev, Nov 07 2007

Extensions

More precise definition from Max Alekseyev, Nov 07 2007
Showing 1-2 of 2 results.