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

A002202 Values taken by totient function phi(m) (A000010).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 22, 24, 28, 30, 32, 36, 40, 42, 44, 46, 48, 52, 54, 56, 58, 60, 64, 66, 70, 72, 78, 80, 82, 84, 88, 92, 96, 100, 102, 104, 106, 108, 110, 112, 116, 120, 126, 128, 130, 132, 136, 138, 140, 144, 148, 150, 156, 160, 162, 164, 166, 168, 172, 176
Offset: 1

Views

Author

Keywords

Comments

These are the numbers n such that for some m the multiplicative group mod m has order n.
Maier & Pomerance show that there are about x * exp(c (log log log x)^2)/log x members of this sequence up to x, with c = 0.81781465... (A234614); see the paper for details on making this precise. - Charles R Greathouse IV, Dec 28 2013
A264739(a(n)) = 1; a(n) occurs A058277(n) times in A007614. - Reinhard Zumkeller, Nov 26 2015
There are no odd numbers > 2 in the sequence and the even numbers that are not in the sequence are in A005277. - Bernard Schott, May 13 2020

References

  • J. W. L. Glaisher, Number-Divisor Tables. British Assoc. Math. Tables, Vol. 8, Camb. Univ. Press, 1940, p. 64.
  • 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).

Crossrefs

Cf. A002110, A005277, A007614, A007617 (complement).
Cf. A083533 (first differences), A264739.
Cf. A006093 (a subsequence).

Programs

  • Haskell
    import Data.List.Ordered (insertSet)
    a002202 n = a002202_list !! (n-1)
    a002202_list = f [1..] (tail a002110_list) [] where
       f (x:xs) ps'@(p:ps) us
         | x < p = f xs ps' $ insertSet (a000010' x) us
         | otherwise = vs ++ f xs ps ws
         where (vs, ws) = span (<= a000010' x) us
    -- Reinhard Zumkeller, Nov 22 2015
  • Maple
    with(numtheory); t1 := [seq(nops(invphi(n)), n=1..300)]; t2 := []: for n from 1 to 300 do if t1[n] <> 0 then t2 := [op(t2), n]; fi; od: t2;
    # second Maple program:
    q:= n-> is(numtheory[invphi](n)<>[]):
    select(q, [$1..176])[];  # Alois P. Heinz, Nov 13 2024
  • Mathematica
    phiQ[m_] := Select[Range[m+1, 2m*Product[(1-1/(k*Log[k]))^(-1), {k, 2, DivisorSigma[0, m]}]], EulerPhi[#] == m &, 1 ] != {}; Select[Range[176], phiQ] (* Jean-François Alcover, May 23 2011, after Maxim Rytin *)
  • PARI
    lst(lim)=my(P=1,q,v);forprime(p=2,default(primelimit), if(eulerphi(P*=p)>=lim,q=p;break));v=vecsort(vector(P/q*lim\eulerphi(P/q),k,eulerphi(k)),,8);select(n->n<=lim,v) \\ Charles R Greathouse IV, Apr 16 2012
    
  • PARI
    select(istotient,vector(100,i,i)) \\ Charles R Greathouse IV, Dec 28 2012
    

A014197 Number of numbers m with Euler phi(m) = n.

Original entry on oeis.org

2, 3, 0, 4, 0, 4, 0, 5, 0, 2, 0, 6, 0, 0, 0, 6, 0, 4, 0, 5, 0, 2, 0, 10, 0, 0, 0, 2, 0, 2, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, 0, 4, 0, 3, 0, 2, 0, 11, 0, 0, 0, 2, 0, 2, 0, 3, 0, 2, 0, 9, 0, 0, 0, 8, 0, 2, 0, 0, 0, 2, 0, 17, 0, 0, 0, 0, 0, 2, 0, 10, 0, 2, 0, 6, 0, 0, 0, 6, 0, 0, 0, 3
Offset: 1

Views

Author

Keywords

Comments

Carmichael conjectured that there are no 1's in this sequence. - Jud McCranie, Oct 10 2000
Number of cyclotomic polynomials of degree n. - T. D. Noe, Aug 15 2003
Let v == 0 (mod 24), w = v + 24, and v < k < q < w, where k and q are integer. It seems that, for most values of v, there is no b such that b = a(k) + a(q) and b > a(v) + a(w). The first case where b > a(v) + a(w) occurs at v = 888: b = a(896) + a(900) = 15 + 4, b > a(888) + a(912), or 19 > 8 + 7. The first case where v < n < w and a(n) > a(v) + a(w) occurs at v = 2232: a(2240) > a(2232) + a(2256), or 27 > 7 + 8. - Sergey Pavlov, Feb 05 2017
One elementary result relating to phi(m) is that if m is odd, then phi(m)=phi(2m) because 1 and 2 both have phi value 1 and phi is multiplicative. - Roderick MacPhee, Jun 03 2017

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section B39, pp. 144-146.
  • Joe Roberts, Lure of The Integers, The Mathematical Association of America, 1992, entry 32, page 182.

Crossrefs

Cf. A000010, A002202, A032446 (bisection), A049283, A051894, A055506, A057635, A057826, A058277 (nonzero terms), A058341, A063439, A066412, A070243 (partial sums), A070633, A071386 (positions of odd terms), A071387, A071388 (positions of primes), A071389 (where prime(n) occurs for the first time), A082695, A097942 (positions of records), A097946, A120963, A134269, A219930, A280611, A280709, A280712, A296655 (positions of positive even terms), A305353, A305656, A319048, A322019.
For records see A131934.
Column 1 of array A320000.

Programs

  • GAP
    a := function(n)
    local S, T, R, max, i, k, r;
    S:=[];
    for i in DivisorsInt(n)+1 do
        if IsPrime(i)=true then
            S:=Concatenation(S,[i]);
        fi;
    od;
    T:=[];
    for k in [1..Size(S)] do
        T:=Concatenation(T,[S[k]/(S[k]-1)]);
    od;
    max := n*Product(T);
    R:=[];
    for r in [1..Int(max)] do
        if Phi(r)=n then
            R:=Concatenation(R,[r]);
        fi;
    od;
    return Size(R);
    end; # Miles Englezou, Oct 22 2024
  • Magma
    [#EulerPhiInverse(n): n in [1..100]]; // Marius A. Burtea, Sep 08 2019
    
  • Maple
    with(numtheory): A014197:=n-> nops(invphi(n)): seq(A014197(n), n=1..200);
  • Mathematica
    a[1] = 2; a[m_?OddQ] = 0; a[m_] := Module[{p, nmax, n, k}, p = Select[ Divisors[m]+1, PrimeQ]; nmax = m*Times @@ (p/(p - 1)); n = m; k = 0; While[n <= nmax, If[EulerPhi[n] == m, k++]; n++]; k]; Array[a, 92] (* Jean-François Alcover, Dec 09 2011, updated Apr 25 2016 *)
    With[{nn = 116}, Function[s, Function[t, Take[#, nn] &@ ReplacePart[t, Map[# -> Length@ Lookup[s, #] &, Keys@ s]]]@ ConstantArray[0, Max@ Keys@ s]]@ KeySort@ PositionIndex@ Array[EulerPhi, Floor[nn^(3/2)] + 10]] (* Michael De Vlieger, Jul 19 2017 *)
  • PARI
    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))))} \\ M. F. Hasler, Oct 05 2009
    
  • PARI
    a(n) = invphiNum(n); \\ Amiram Eldar, Nov 15 2024 using Max Alekseyev's invphi.gp
    
  • Python
    from sympy import totient, divisors, isprime, prod
    def a(m):
        if m == 1: return 2
        if m % 2: return 0
        X = (x + 1 for x in divisors(m))
        nmax=m*prod(i/(i - 1) for i in X if isprime(i))
        n=m
        k=0
        while n<=nmax:
            if totient(n)==m:k+=1
            n+=1
        return k
    print([a(n) for n in range(1, 51)]) # Indranil Ghosh, Jul 18 2017, after Mathematica code
    

Formula

Dirichlet g.f.: Sum_{n>=1} a(n)*n^-s = zeta(s)*Product_(1+1/(p-1)^s-1/p^s). - Benoit Cloitre, Apr 12 2003
Limit_{n->infinity} (1/n) * Sum_{k=1..n} a(k) = zeta(2)*zeta(3)/zeta(6) = 1.94359643682075920505707036... (see A082695). - Benoit Cloitre, Apr 12 2003
From Christopher J. Smyth, Jan 08 2017: (Start)
Euler transform = Product_{n>=1} (1-x^n)^(-a(n)) = g.f. of A120963.
Product_{n>=1} (1+x^n)^a(n)
= Product_{n>=1} ((1-x^(2n))/(1-x^n))^a(n)
= Product_{n>=1} (1-x^n)^(-A280712(n))
= Euler transform of A280712 = g.f. of A280611.
(End)
a(A000010(n)) = A066412(n). - Antti Karttunen, Jul 18 2017
From Antti Karttunen, Dec 04 2018: (Start)
a(A000079(n)) = A058321(n).
a(A000142(n)) = A055506(n).
a(A017545(n)) = A063667(n).
a(n) = Sum_{d|n} A008683(n/d)*A070633(d).
a(n) = A056239(A322310(n)).
(End)

A210500 Number of even solutions to phi(k) = prime(n) - 1.

Original entry on oeis.org

1, 2, 3, 2, 1, 4, 5, 2, 1, 1, 1, 5, 6, 2, 1, 1, 1, 5, 1, 1, 11, 1, 1, 4, 13, 2, 1, 1, 5, 4, 1, 1, 1, 1, 1, 1, 4, 2, 1, 1, 1, 5, 1, 17, 1, 1, 1, 1, 1, 1, 4, 1, 21, 1, 9, 1, 1, 1, 5, 5, 1, 1, 1, 1, 10, 1, 1, 13, 1, 3, 9, 1, 1, 1, 1, 1, 1, 7, 9, 4, 1, 7, 1, 23, 1, 1, 9
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jan 19 2013

Keywords

Comments

a(n) >= A210501(n).

Examples

			The set {k: phi(k) = 12} is {13, 21, 26, 28, 36, 42}. Thus, if phi(k) = prime(6) - 1, the equation has exactly four even solutions. Hence, a(6) = 4.
		

References

  • Alexander S. Karpenko, Lukasiewicz's Logics and Prime Numbers, Luniver Press, Beckington, 2006, pp. 52-56.

Crossrefs

Programs

  • Mathematica
    r = 87; lst1 = Table[EulerPhi[n], {n, (Prime[r] - 1)^2 + 2}]; lst2 = {}; Do[p = Prime[n]; AppendTo[lst2, Length@Select[Flatten@Position[Take[lst1, {p - 1, (p - 1)^2 + 2}], Prime[n] - 1], OddQ]], {n, r}]; lst2

Formula

a(n) = A058339(n) - A210501(n).

A210501 Number of odd solutions to phi(k) = prime(n) - 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 3, 3, 2, 1, 1, 1, 4, 1, 1, 6, 1, 1, 2, 4, 2, 1, 1, 4, 2, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 5, 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, 10, 1, 1, 1, 1, 1, 4, 3, 1, 1, 1, 1, 6, 1, 1, 5, 1, 3, 3, 1, 1, 1, 1, 1, 1, 6, 4, 2, 1, 6, 1, 11, 1, 1, 3
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jan 19 2013

Keywords

Comments

a(n) <= A210500(n).

Examples

			The set {k: phi(k) = 12} is {13, 21, 26, 28, 36, 42}. Thus, if phi(k) = prime(6) - 1, the equation has exactly two odd solutions. Hence, a(6) = 2.
		

References

  • Alexander S. Karpenko, Lukasiewicz's Logics and Prime Numbers, Luniver Press, Beckington, 2006, pp. 52-56.

Crossrefs

Programs

  • Mathematica
    r = 87; lst1 = Table[EulerPhi[n], {n, (Prime[r] - 1)^2 + 1}]; lst2 = {}; Do[p = Prime[n]; AppendTo[lst2, Length@Select[Flatten@Position[Take[lst1, {p - 1, (p - 1)^2 + 1}], Prime[n] - 1], EvenQ]], {n, r}]; lst2

Formula

a(n) = A058339(n) - A210500(n).

A051478 a(n) is the number of values k satisfying phi(k) = 4*n+2, n>0.

Original entry on oeis.org

4, 2, 0, 4, 2, 0, 2, 0, 0, 4, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 4, 2, 0, 0, 2, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 2, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Sequence consists of only 0's, 2's and 4's.

Examples

			phi(k) = 4*1+2 has 4 solutions (k = 7, 9, 14, 18), so a(1) = 4.
		

Crossrefs

Programs

A051479 Values of i such that phi(x) = 4i+2 has 4 solutions.

Original entry on oeis.org

1, 4, 10, 40, 121, 364, 1105, 1540, 3601, 4795, 5662, 6601, 9841, 19414, 35815, 103201, 131950, 141224, 210910, 245272, 378532, 505876, 613480, 762565, 986545, 1010527, 1147576, 1252720, 1732847, 1750990, 1766905, 1798951, 1863907, 2337352, 2674042, 2773057, 3080902
Offset: 1

Views

Author

Keywords

Examples

			phi(x) = 4*1+2 has 4 solutions (x = 7,9,14,18), so 1 is in the sequence.
		

Crossrefs

Programs

Extensions

a(33)-a(37) from Amiram Eldar, Nov 05 2024

A085758 Least m such that phi(x)=2m has exactly n solutions.

Original entry on oeis.org

5, 1, 2, 4, 6, 16, 18, 20, 12, 24, 80, 198, 1134, 352, 156, 36, 168, 108, 468, 72, 312, 528, 880, 180, 1280, 192, 144, 660, 1848, 120, 384, 4500, 216, 3564, 2100, 240, 288, 648, 600, 7968, 1656, 1536, 1620, 432, 1560, 3672, 1944, 360, 840, 2496, 8820, 1008, 576
Offset: 2

Views

Author

Lekraj Beedassy, Jul 22 2003

Keywords

Comments

Sequence refers to the rank of the first occurrence of n in A032446.

Examples

			a(0) = 7. Carmichael conjectured that a(1) doesn't exist.
		

Crossrefs

Cf. A032446.

Formula

a(n) = A007374(n)/2 for n > 2. - David Wasserman, Feb 09 2005

Extensions

More terms from David Wasserman, Feb 09 2005

A172464 Numbers n such that phi(phi(n)) + sigma(sigma(n)) is a 4th power.

Original entry on oeis.org

9, 42, 101, 339, 407, 420, 471, 915, 1409, 2572, 2847, 3706, 4069, 6631, 6720, 7229, 9212, 14051, 16641, 31453, 33067, 33146, 35701, 37425, 37675, 37911, 48016, 48272, 53101, 55956, 56906, 68895, 73474, 75023, 83525, 84676, 86928, 94525, 101428, 101743, 115925
Offset: 1

Views

Author

Michel Lagneau, Feb 03 2010

Keywords

Examples

			phi(phi(9)) + sigma(sigma(9))= 1;
phi(phi(42)) + sigma(sigma(42))= 4^4 = 256;
phi(phi(101)) + sigma(sigma(101))= 4^4 = 256;
phi(phi(339)) + sigma(sigma(339))= 6^4 = 1296.
		

References

  • W. L. Glaisher, Number-Divisor Tables. British Assoc. Math. Tables, Vol. 8, Camb. Univ. Press, 1940, p. 64.
  • S. W. Golomb, Equality among number-theoretic functions, Abstract 882-11-16, Abstracts Amer. Math. Soc., 14 (1993), 415-416.
  • R. K. Guy, Unsolved Problems in Number Theory, B42.

Crossrefs

Programs

  • Maple
    with(numtheory): for n from 1 to 2000000 do;if floor(( phi(phi(n)) + sigma(sigma(n)))^.25) =( phi(phi(n)) + sigma(sigma(n)))^.25 then print (n);fi ; od;
  • Mathematica
    Select[Range[116000],IntegerQ[Surd[DivisorSigma[1,DivisorSigma[1,#]]+ EulerPhi[ EulerPhi[ #]],4]]&] (* Harvey P. Dale, Aug 16 2021 *)

Extensions

a(40)-a(41) from Hiroaki Yamanouchi, Sep 19 2014

A172465 Numbers n such that phi(phi(n)) + sigma(sigma(n)) is an 8th power.

Original entry on oeis.org

42, 101, 6720, 9212, 226570, 276404, 288086, 299668, 339098, 392228, 412276, 423395, 530917, 535759, 559427, 564209, 666181, 2835284, 3592300, 3911744, 4080100, 5980673, 7230960, 8787900, 14960924, 17130550, 23324242, 27449729, 30437729, 33869141, 42073800
Offset: 1

Views

Author

Michel Lagneau, Feb 03 2010

Keywords

Examples

			phi(phi(9)) + sigma(sigma(9))= 1;
phi(phi(42)) + sigma(sigma(42))= 2^8 = 256;
phi(phi(101)) + sigma(sigma(101))= 2^8 = 256;
phi(phi(6720)) + sigma(sigma(6720))= 4^8 = 65536.
		

References

  • W. L. Glaisher, Number-Divisor Tables. British Assoc. Math. Tables, Vol. 8, Camb. Univ. Press, 1940, p. 64.
  • S. W. Golomb, Equality among number-theoretic functions, Abstract 882-11-16, Abstracts Amer. Math. Soc., 14 (1993), 415-416.
  • R. K. Guy, Unsolved Problems in Number Theory, B42.

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 2000000 do;if floor(( phi(phi(n)) + sigma(sigma(n)))^.125) = (phi(phi(n)) + sigma(sigma(n)))^.125 then print (n);fi ; od;
  • PARI
    isok(n) = ispower(eulerphi(eulerphi(n)) + sigma(sigma(n)), 8); \\ Michel Marcus, Sep 20 2014

Extensions

a(10) corrected and a(18)-a(31) added by Hiroaki Yamanouchi, Sep 19 2014

A296655 Numbers k such that phi(x) = k has a positive even number of solutions.

Original entry on oeis.org

1, 4, 6, 10, 12, 16, 18, 22, 24, 28, 30, 36, 42, 46, 52, 54, 58, 64, 66, 70, 78, 80, 82, 84, 88, 100, 102, 106, 110, 112, 126, 130, 136, 138, 148, 150, 160, 162, 166, 168, 172, 176, 178, 180, 184, 190, 196, 198, 200, 208, 210, 222, 224, 226, 228, 232, 238, 250
Offset: 1

Views

Author

Torlach Rush, Dec 17 2017

Keywords

Comments

When the number of solutions is 2, the sum of Sum_{d|x} d*mu(d) is always 0.
A007366 is contained in this sequence because it selects terms with the smallest even number of inverses.

Examples

			1 is a term because phi(1) has two inverses, 1, and 2.
6 is a term because phi(6) has four inverses, 7, 9, 14, and 18.
10 is a term because phi(10) has two inverses, 11, and 22.
18 is a term because phi(18) has four inverses, 19, 27, 38, 54.
348 is a term because phi(348) has six inverses, 349, 413, 531, 698, 826, and 1062.
		

Crossrefs

Programs

  • Mathematica
    With[{nn = 1500}, TakeWhile[Union@ Select[KeyValueMap[{#1, Length@ #2} &, PositionIndex@ Array[EulerPhi, nn]], EvenQ@ Last@ # &][[All, 1]], # <= nn/6 &] ] (* Michael De Vlieger, Dec 20 2017 *)

Formula

0 = card({phi^-1(a(n))}) mod 2.

Extensions

Corrected and extended by Rémy Sigrist, Dec 19 2017
Showing 1-10 of 10 results.