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-3 of 3 results.

A039770 Numbers k such that phi(k) is a perfect square.

Original entry on oeis.org

1, 2, 5, 8, 10, 12, 17, 32, 34, 37, 40, 48, 57, 60, 63, 74, 76, 85, 101, 108, 114, 125, 126, 128, 136, 160, 170, 185, 192, 197, 202, 204, 219, 240, 250, 257, 273, 285, 292, 296, 304, 315, 364, 370, 380, 394, 401, 432, 438, 444, 451, 456, 468, 489, 504, 505
Offset: 1

Views

Author

Keywords

Comments

A004171 is a subsequence because phi(2^(2k+1)) = (2^k)^2. - Enrique Pérez Herrero, Aug 25 2011
Subsequence of primes is A002496 since in this case phi(k^2+1) = k^2. - Bernard Schott, Mar 06 2023
Products of distinct terms of A002496 form a subsequence. - Chai Wah Wu, Aug 22 2025

Examples

			phi(34) = 16 = 4*4.
		

References

  • D. M. Burton, Elementary Number Theory, Allyn and Bacon Inc., Boston MA, 1976, p. 141.

Crossrefs

Cf. A000010, A007614. A062732 gives the squares. A306882 (squares not totient).

Programs

  • Maple
    with(numtheory); isA039770 := proc (n) return issqr(phi(n)) end proc; seq(`if`(isA039770(n), n, NULL), n = 1 .. 505); # Nathaniel Johnston, Oct 09 2013
  • Mathematica
    Select[ Range[ 600 ], IntegerQ[ Sqrt[ EulerPhi[ # ] ] ]& ]
  • PARI
    for(n=1, 120, if (issquare(eulerphi(n)), print1(n, ", ")))
    
  • Python
    from math import isqrt
    from sympy import totient as phi
    def ok(n): return isqrt(p:=phi(n))**2 == p
    print([k for k in range(1, 506) if ok(k)]) # Michael S. Branicky, Aug 17 2025

Formula

a(n) seems to be asymptotic to c*n^(3/2) with 1 < c < 1.3. - Benoit Cloitre, Sep 08 2002
Banks, Friedlander, Pomerance, and Shparlinski show that a(n) = O(n^1.421). - Charles R Greathouse IV, Aug 24 2009

A054755 Odd powers of primes of the form q = x^2 + 1 (A002496).

Original entry on oeis.org

2, 5, 8, 17, 32, 37, 101, 125, 128, 197, 257, 401, 512, 577, 677, 1297, 1601, 2048, 2917, 3125, 3137, 4357, 4913, 5477, 7057, 8101, 8192, 8837, 12101, 13457, 14401, 15377, 15877, 16901, 17957, 21317, 22501, 24337, 25601, 28901, 30977, 32401
Offset: 1

Views

Author

Labos Elemer, Apr 25 2000

Keywords

Comments

A002496 is a subset; the odd power exponent is 1.
From Bernard Schott, Mar 16 2019: (Start)
The terms of this sequence are exactly the integers with only one prime factor and whose Euler's totient is square, so this sequence is a subsequence of A039770. The primitive terms of this sequence are the primes of the form q = x^2 + 1, which are exactly in A002496.
Additionally, the terms of this sequence also have a square cototient, so this sequence is a subsequence of A063752 and A054754.
If q prime = x^2 + 1, phi(q) = x^2, phi(q^(2k+1)) = (x*q^k)^2, and cototient(q) = 1^2, cototient(q^(2k+1)) = (q^k)^2. (End)

Examples

			a(20) = 3125 = 5^5, q = 5 = 4^2+1 and Phi(3125) = 2500 = 50^2, cototient(3125) = 3125 - Phi(3125) = 625 = 25^2.
		

Crossrefs

Cf. A000010, A051953, A039770, A063752, A054754, A334745 (with 2 distinct prime factors), A306908 (with 3 distinct prime factors).
Subsequences: A002496 (primitive primes: m^2+1), A004171 (2^(2k+1)), A013710 (5^(2k+1)), A013722 (17^(2k+1)), A262786 (37^(2k+1)).

Programs

  • Mathematica
    Select[Range[10^5], And[PrimeNu@ # == 1, IntegerQ@ Sqrt@ EulerPhi@ #] &] (* Michael De Vlieger, Mar 31 2019 *)
  • PARI
    isok(m) = (omega(m)==1) && issquare(eulerphi(m)); \\ Michel Marcus, Mar 16 2019
    
  • PARI
    upto(n) = {my(res = List([2]), q); forstep(i = 2, sqrtint(n), 2, if(isprime(i^2 + 1), listput(res, i^2 + 1) ) ); q = #res; forstep(i = 3, logint(n, 2), 2, for(j = 1, q, c = res[j]^i; if(c <= n, listput(res, c) , next(2) ) ) ); listsort(res); res } \\ David A. Corneth, Mar 17 2019

Formula

A000010(a(n)) = (q^(2k))*(q-1) and A051953(a(n)) = q^(2k), where q = 1 + x^2 and is prime.

A324746 Numbers k with exactly two distinct prime factors and such that phi(k) is square, when k = p^(2s+1) * q^(2t+1) with p < q primes, s,t >= 0.

Original entry on oeis.org

10, 34, 40, 57, 74, 85, 136, 160, 185, 202, 219, 250, 296, 394, 451, 489, 505, 513, 514, 544, 629, 640, 679, 802, 808, 985, 1000, 1057, 1154, 1184, 1285, 1354, 1387, 1417, 1576, 1717, 1971, 2005, 2047, 2056, 2125, 2176, 2509, 2560, 2594, 2649, 2761, 2885, 3097
Offset: 1

Views

Author

Bernard Schott, Mar 12 2019

Keywords

Comments

An integer belongs to this sequence iff (p-1)*(q-1) = m^2.
This is the first subsequence of A324745, the second one is A324747.
Some values of (k,p,q,m): (10,2,5,2), (34,2,17,4), (40,2,5,4), (57,3,19,4), (74,2,37,6), (85,5,17,8).
The primitive terms of this sequence are the products p * q, with p < q which satisfy (p-1)*(q-1) = m^2; the first few are 10, 34, 57, 74, 85, 185. These primitives form exactly the sequence A247129. Then the integers (p*q) * p^2 and (p*q) * q^2 are new terms of the general sequence.
The number of semiprimes p*q whose totient is a square equal to (2*n)^2 can be found in A306722.

Examples

			629 = 17 * 37 and phi(629) = 16 * 36 = 9^2.
808 = 2^3 * 101 and phi(808) = (2^1 * 101^0 * 10)^2 = 20^2.
		

Crossrefs

Cf. A306722, A247129 (subsequence of primitives).

Programs

  • Maple
    N:= 10^4:
    Res:= {}:
    p:= 1:
    do
      p:= nextprime(p);
      if p^2 >= N then break fi;
      F:= ifactors(p-1)[2];
      dm:= mul(t[1]^ceil(t[2]/2),t=F);
      for j from (p-1)/dm+1 do
        q:= (j*dm)^2/(p-1) + 1;
        if q > N then break fi;
        if isprime(q) then Res:= Res union {seq(seq(
          p^(2*s+1)*q^(2*t+1),t=0..floor((log[q](N/p^(2*s+1))-1)/2)),
          s=0..floor((log[p](N/q)-1)/2))} fi
      od
    od:
    sort(convert(Res,list)); # Robert Israel, Mar 22 2019
  • Mathematica
    Select[Range[6, 3100], And[PrimeNu@ # == 2, IntegerQ@ Sqrt@ EulerPhi@ #, IntegerQ@ Sqrt[Times @@ (FactorInteger[#][[All, 1]] - 1 )]] &] (* Michael De Vlieger, Mar 24 2019 *)
  • PARI
    isok(k) = {if (issquare(eulerphi(k)), my(expo = factor(k)[,2]); if ((#expo == 2)&& (expo[1]%2) == (expo[2]%2), return (1)););} \\ Michel Marcus, Mar 18 2019

Formula

phi(p*q) = (p-1)*(q-1) = m^2 for primitive terms.
phi(k) = (p^s * q^t * m)^2 with k as in the name of this sequence.
Showing 1-3 of 3 results.