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

A054756 Numbers k such that phi(k) and cototient(k) are squares but k is not in A054755.

Original entry on oeis.org

1, 468, 1417, 1872, 2340, 3145, 4100, 4212, 7488, 9360, 14841, 15588, 16400, 16848, 20329, 21060, 29952, 31417, 37440, 37908, 45097, 49833, 58500, 62352, 63529, 63945, 65600, 67392, 69700, 78625, 79092, 83569, 84169, 84240, 88929, 102500
Offset: 1

Views

Author

Labos Elemer, Apr 25 2000

Keywords

Examples

			An even term is 2340 = 4*9*5*13 (phi = 576 = 24^2 and cototient = 1764 =  42^2).
An odd term is 14841 = 9*17*97 (phi = 9216 = 96^2, cototient = 5625 = 75^2).
		

Crossrefs

Equals A054754 \setminus A054755. See also A063752.

Programs

  • Mathematica
    Select[ Range[ 1, 200000 ], IntegerQ[ Sqrt[ eu[ # ] ] ]&& IntegerQ[ Sqrt[ co[ # ] ] ]&&!Equal[ lfi[ # ], 1 ]& ], where eu[ x_ ] =EulerPhi[ x ], co[ x_ ]=x-EulerPhi[ x ] and lfi[ x_ ]=Length[ FactorInteger[ x ] ]

Formula

phi(a(n)) = x^2, a(n) - phi(a(n)) = y^2, a(n) is not an odd power of prime from A002496.

A002496 Primes of the form k^2 + 1.

Original entry on oeis.org

2, 5, 17, 37, 101, 197, 257, 401, 577, 677, 1297, 1601, 2917, 3137, 4357, 5477, 7057, 8101, 8837, 12101, 13457, 14401, 15377, 15877, 16901, 17957, 21317, 22501, 24337, 25601, 28901, 30977, 32401, 33857, 41617, 42437, 44101, 50177
Offset: 1

Views

Author

Keywords

Comments

It is conjectured that this sequence is infinite, but this has never been proved.
An equivalent description: primes of form P = (p1*p2*...*pm)^k + 1 where p1..pm are primes and k > 1, since then k must be even for P to be prime.
Also prime = p(n) if A054269(n) = 1, i.e., quotient-cycle-length = 1 in continued fraction expansion of sqrt(p). - Labos Elemer, Feb 21 2001
Also primes p such that phi(p) is a square.
Also primes of form x*y + z, where x, y and z are three successive numbers. - Giovanni Teofilatto, Jun 05 2004
It is a result that goes back to Mirsky that the set of primes p for which p-1 is squarefree has density A, where A = A005596 denotes the Artin constant. More precisely, Sum_{p <= x} mu(p-1)^2 = A*x/log x + o(x/log x) as x tends to infinity. Conjecture: Sum_{p <= x, mu(p-1)=1} 1 = (A/2)*x/log x + o(x/log x) and Sum_{p <= x, mu(p-1)=-1} 1 = (A/2)*x/log x + o(x/log x). - Pieter Moree (moree(AT)mpim-bonn.mpg.de), Nov 03 2003
Also primes of the form x^y + 1, where x > 0, y > 1. Primes of the form x^y - 1 (x > 0, y > 1) are the Mersenne primes listed in A000668(n) = {3, 7, 31, 127, 8191, 131071, 524287, 2147483647, ...}. - Alexander Adamchuk, Mar 04 2007
With the exception of the first two terms {2,5}, the continued fraction (1 + sqrt(p))/2 has period 3. - Artur Jasinski, Feb 03 2010
With the exception of the first term {2}, congruent to 1 (mod 4). - Artur Jasinski, Mar 22 2011
With the exception of the first two terms, congruent to 1 or 17 (mod 20). - Robert Israel, Oct 14 2014
From Bernard Schott, Mar 22 2019: (Start)
These primes are the primitive terms which generate the sequence of integers with only one prime factor and whose Euler's totient is a square: A054755. So this sequence is a subsequence of A054755 and of A039770. Additionally, the terms of this sequence also have a square cototient, so this sequence is a subsequence of A063752 and A054754.
If p prime = n^2 + 1, phi(p) = n^2 and cototient(p) = 1^2.
Except for 3, the four Fermat primes in A019434 {5, 17, 257, 65537}, belong to this sequence; with F_k = 2^(2^k) + 1, phi(F_k) = (2^(2^(k-1)))^2.
See the file "Subfamilies and subsequences" (& I) in A039770 for more details, proofs with data, comments, formulas and examples. (End)
In this sequence, primes ending with 7 seem to appear twice as often as primes ending with 1. This is because those with 7 come from integers ending with 4 or 6, while those with 1 come only from integers ending with 0 (see De Koninck & Mercier reference). - Bernard Schott, Nov 29 2020
The set of odd primes p for which every elliptic curve of the form y^2 = x^3 + d*x has order p-1 over GF(p) for those d with (d,p)=1 and d a fourth power modulo p. - Gary Walsh, Sep 01 2021 [edited, Gary Walsh, Apr 26 2025]

References

  • Jean-Marie De Koninck & Armel Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 211 pp. 34 and 169, Ellipses, Paris, 2004.
  • Leonhard Euler, De numeris primis valde magnis (E283), reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 3, p. 22.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 17.
  • Hugh L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 208.
  • C. Stanley Ogilvy, Tomorrow's Math. 2nd ed., Oxford Univ. Press, 1972, p. 116.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 118.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 134.

Crossrefs

Cf. A083844 (number of these primes < 10^n), A199401 (growth constant).
Cf. A000668 (Mersenne primes), A019434 (Fermat primes).
Subsequence of A039770.
Cf. A010051, subsequence of A002522.
Cf. A237040 (an analog for n^3 + 1).
Cf. A010051, A000290; subsequence of A028916.
Subsequence of A039770, A054754, A054755, A063752.
Primes of form n^2+b^4, b fixed: A243451 (b=2), A256775 (b=3), A256776 (b=4), A256777 (b=5), A256834 (b=6), A256835 (b=7), A256836 (b=8), A256837 (b=9), A256838 (b=10), A256839 (b=11), A256840 (b=12), A256841 (b=13).
Cf. A030430 (primes ending with 1), A030432 (primes ending with 7).

Programs

  • Haskell
    a002496 n = a002496_list !! (n-1)
    a002496_list = filter ((== 1) . a010051') a002522_list
    -- Reinhard Zumkeller, May 06 2013
    
  • Magma
    [p: p in PrimesUpTo(100000)| IsSquare(p-1)]; // Vincenzo Librandi, Apr 09 2011
    
  • Maple
    select(isprime, [2, seq(4*i^2+1, i= 1..1000)]); # Robert Israel, Oct 14 2014
  • Mathematica
    Select[Range[100]^2+1, PrimeQ]
    Join[{2},Select[Range[2,300,2]^2+1,PrimeQ]] (* Harvey P. Dale, Dec 18 2018 *)
  • PARI
    isA002496(n) = isprime(n) && issquare(n-1) \\ Michael B. Porter, Mar 21 2010
    
  • PARI
    is_A002496(n)=issquare(n-1)&&isprime(n) \\ For "random" numbers in the range 10^10 and beyond, at least 5 times faster than the above. - M. F. Hasler, Oct 14 2014
    
  • Python
    # Python 3.2 or higher required
    from itertools import accumulate
    from sympy import isprime
    A002496_list = [n+1 for n in accumulate(range(10**5),lambda x,y:x+2*y-1) if isprime(n+1)] # Chai Wah Wu, Sep 23 2014
    
  • Python
    # Python 2.4 or higher required
    from sympy import isprime
    A002496_list = list(filter(isprime, (n*n+1 for n in range(10**5)))) # David Radcliffe, Jun 26 2016

Formula

There are O(sqrt(n)/log(n)) terms of this sequence up to n. But this is just an upper bound. See the Bateman-Horn or Wolf papers, for example, for the conjectured for what is believed to be the correct density.
a(n) = 1 + A005574(n)^2. - R. J. Mathar, Jul 31 2015
Sum_{n>=1} 1/a(n) = A172168. - Amiram Eldar, Nov 14 2020
a(n+1) = 4*A001912(n)^2 + 1. - Hal M. Switkay, Apr 03 2022

Extensions

Formula, reference, and comment from Charles R Greathouse IV, Aug 24 2009
Edited by M. F. Hasler, Oct 14 2014

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

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

Original entry on oeis.org

12, 48, 63, 76, 108, 192, 292, 304, 432, 567, 652, 768, 873, 972, 1168, 1216, 1359, 1728, 2107, 2608, 3072, 3087, 3532, 3888, 4383, 4525, 4612, 4672, 4864, 5103, 5409, 5836, 6543, 6912, 7204, 7857, 8716, 8748, 10372, 10432, 12231, 12288
Offset: 1

Views

Author

Bernard Schott, Mar 13 2019

Keywords

Comments

An integer belongs to this sequence iff p*(p-1)*(q-1) = m^2.
This is the second subsequence of A324745, the first one is A324746.
Some values of (k,p,q,m): (12,2,3,2), (63,3,7,6), (76,2,19,6), (292,2,73,12), (652,2,163,18), (873,3,97,24).
The primitive terms of this sequence are the products p^2 * q, with p<>q which satisfy p*(p-1)*(q-1) = m^2. The first few primitive terms are: 12, 63, 76, 292, 652, 873.. Then the integers (p^2 * q) * p^2 and (p^2 * q) * q^2 are new terms of the general sequence.

Examples

			63 = 3^2 * 7 and phi(63) = 3*2*6 = 6^2.
1728 = 2^6 * 3^3 and phi(1728) = (2^2 * 3^1 * 2)^2 = 24^2.
		

Crossrefs

Programs

  • 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^2 * q) = p*(p-1)*(q-1) = m^2 for primitive terms.
phi(k) = (p^(s-1) * q^t * m)^2 with k as in the name of this sequence.

A306908 Numbers k with exactly three distinct prime factors and such that phi(k) is a square.

Original entry on oeis.org

60, 114, 126, 170, 204, 240, 273, 285, 315, 364, 370, 380, 438, 444, 456, 468, 504, 540, 680, 816, 825, 902, 960, 969, 978, 1010, 1026, 1071, 1095, 1100, 1134, 1212, 1258, 1292, 1358, 1456, 1460, 1480, 1500, 1520, 1729, 1746, 1752, 1776, 1824, 1836, 1872
Offset: 1

Views

Author

Bernard Schott, Mar 16 2019

Keywords

Comments

This sequence is the intersection of A033992 and A039770.
The integers with only one prime factor and whose totient is a square are in A002496 and A054755, the integers with two prime factors and whose totient is a square are in A324745, A324746 and A324747.

Examples

			1st family: 273 = 3 * 7 * 13 and phi(273) = 12^2.
2nd family: 816 = 2^4 * 3 * 17 and phi(816) = 16^2.
3rd family: 6975 = 3^2 * 5^2 * 31 and phi(6975) = 60^2.
		

Crossrefs

Intersection of A033992 and A039770.
Cf. A002496, A054755 (only one prime factor), A324745, A324746, A324747 (two prime factors).

Programs

  • Maple
    filter:= n -> issqr(numtheory:-phi(n)) and nops
    (numtheory:-factorset(n))=3:
    select(filter, [$1..2000]); # after Robert Israel in A324745
  • Mathematica
    Select[Range[2000], And[PrimeNu@ # == 3, IntegerQ@ Sqrt@ EulerPhi@ #] &] (* Michael De Vlieger, Mar 31 2019 *)
  • PARI
    isok(n) = (omega(n)==3) && issquare(eulerphi(n)); \\ Michel Marcus, Mar 19 2019

Formula

1st family: The primitive terms are p*q*r with p,q,r primes and phi(p*q*r) = (p-1)*(q-1)*(r-1) = m^2. These primitives generate the entire family formed by the numbers k = p^(2s+1) * q^(2t+1) * r^(2u+1) with s,t,u >= 0, and phi(k) = (p^s * q^t * r^u * m)^2.
2nd family: The primitive terms are p^2 * q * r with p,q,r primes and phi(p^2 * q * r) = p*(p-1)*(q-1)*(r-1) = m^2. These primitives generate the entire family formed by the numbers k = p^(2s) * q^(2t+1) * r^(2u+1) with s >= 1, t,u >= 0, and phi(k) = (p^(s-1) * q^t * r^u * m)^2.
3rd family: The primitive terms are p^2 * q^2 * r with p,q,r primes and phi(p^2 * q^2 * r) = p*q*(p-1)*(q-1)*(r-1) = m^2. These primitives generate the entire family formed by the numbers k = p^(2s) * q^(2t) * r^(2u+1) with s,t> = 1, u >= 0, and phi(k) = (p^(s-1) * q^(t-1) * r^u * m)^2.

A324745 Numbers k with exactly two distinct prime factors and such that phi(k) is a square.

Original entry on oeis.org

10, 12, 34, 40, 48, 57, 63, 74, 76, 85, 108, 136, 160, 185, 192, 202, 219, 250, 292, 296, 304, 394, 432, 451, 489, 505, 513, 514, 544, 567, 629, 640, 652, 679, 768, 802, 808, 873, 972, 985, 1000, 1057, 1154, 1168, 1184, 1216, 1285, 1354
Offset: 1

Views

Author

Bernard Schott, Mar 12 2019

Keywords

Comments

This sequence is the intersection of A007774 and A039770.
The sequences A324746 and A324747 form a partition of this sequence.
See the file "Subfamilies and subsequences" (& II) in A039770 for more details, proofs with data, comments, formulas and examples.
The integers with only one prime factor and whose totient is a square are in A054755.

Examples

			1st family: 136 = 2^3 * 37 and phi(136) = 8^2.
2nd family: 652 = 2^2 * 163 and phi(652) = 18^2.
		

Crossrefs

Intersection of A007774 and A039770.

Programs

  • Maple
    filter:= n -> issqr(numtheory:-phi(n)) and nops(numtheory:-factorset(n))=2:
    select(filter, [$1..2000]); # Robert Israel, Mar 18 2019
  • Mathematica
    Select[Range[1400], And[PrimeNu[#] == 2, IntegerQ@ Sqrt@ EulerPhi@ #] &] (* Michael De Vlieger, Mar 21 2019 *)
  • PARI
    isok(n) = (omega(n)==2) && issquare(eulerphi(n)); \\ Michel Marcus, Mar 17 2019

Formula

1st family (A324746): The primitive terms are defined by p*q, p < q, with phi(p*q) = (p-1)*(q-1) = m^2. The general terms are defined by k = p^(2s+1) * q^(2t+1), s,t >= 0, with phi(k) = (p^s * q^t * m)^2.
2nd family (A324747): The primitive terms are defined by p^2 * q, p <> q, with phi(p^2 * q) = p*(p-1)*(q-1) = m^2. The general terms are defined by k = p^(2s ) * q^(2t+1), s >= 1, t >= 0, with phi(k) = (p^(s-1) * q^t * m)^2.

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.

A307690 Integers with only one prime factor and whose Euler's totient is a perfect biquadrate.

Original entry on oeis.org

2, 17, 32, 257, 512, 1297, 8192, 65537, 131072, 160001, 331777, 614657, 1336337, 1419857, 2097152, 4477457, 5308417, 8503057, 9834497, 29986577, 33554432, 40960001, 45212177, 59969537, 65610001, 126247697, 193877777, 303595777, 384160001, 406586897, 536870912, 562448657, 655360001
Offset: 1

Views

Author

Bernard Schott, Apr 22 2019

Keywords

Comments

An integer q is a term iff q = p^(4*m+1), when p is prime of the form k^4 + 1 and m >= 0, then phi(q) = (k * (k^4+1)^m)^4. The primitive terms of this sequence are the primes of the form p = k^4 + 1, which are exactly in A037896.

Examples

			a(14) = 1419857 = 17^5 and phi(1419857) = 34^4.
		

Crossrefs

Subsequences: A013776 (2^(4*m+1)), A013806 (17^(4*m+1)), A037896 (primes of the form k^4 + 1).
Intersection of A078164 and A246655.
Cf. A054755 (idem with Euler's totient is square).

Programs

  • Magma
    [n:n in [1..10000000]| #PrimeDivisors(n) eq 1 and IsPower(EulerPhi(n),4)]; // Marius A. Burtea, May 09 2019
  • PARI
    isok(n) = isprimepower(n) && ispower(eulerphi(n), 4); \\ Michel Marcus, Apr 23 2019
    
Showing 1-8 of 8 results.