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

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)

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

A328412 Number of solutions to (Z/mZ)* = C_2 X C_(2n), where (Z/mZ)* is the multiplicative group of integers modulo m.

Original entry on oeis.org

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

Views

Author

Jianing Song, Oct 14 2019

Keywords

Comments

It is sufficient to check all numbers in the range [A049283(4n), A057635(4n)] for m if 4n is a totient number.
Conjecture: every number occurs in this sequence. That is to say, A328416(n) > 0 for every n.
Conjecture: this sequence is unbounded. That is to say, A328417 and A328418 are infinite.

Examples

			See the a-file for the solutions to (Z/mZ)* = C_2 X C_(2n) for n <= 5000.
		

Crossrefs

Cf. A328413 (numbers k such that a(k) > 0), A328414 (indices of 0), A328415 (indices of 1).
Cf. A328416 (smallest k such that a(k) = n).
Cf. A328417, A328418 (records in this sequence).
Cf. also A049823, A057635.

Programs

  • PARI
    a(n) = my(i=0, r=4*n, N=floor(exp(Euler)*r*log(log(r^2))+2.5*r/log(log(r^2)))); for(k=r+1, N, if(eulerphi(k)==r && lcm(znstar(k)[2])==r/2, i++)); i

A347771 Unitary nontotient numbers: values not in range of unitary totient function uphi(n).

Original entry on oeis.org

5, 9, 11, 13, 17, 19, 21, 23, 25, 27, 29, 33, 34, 35, 37, 38, 39, 41, 43, 45, 47, 49, 50, 51, 53, 55, 57, 59, 61, 65, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 81, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97, 98, 99, 101, 103, 105, 107, 109, 110, 111, 113, 114, 115, 117, 118, 119, 121, 122, 123, 125, 129, 131, 133, 134, 135
Offset: 1

Views

Author

Eric Chen, Sep 13 2021

Keywords

Comments

Numbers not appearing in A047994.
Indices of -1 in A135347.
Unitary version of A007617.
This sequence to A047994 is A007617 to A000010.
This sequence to A135347 is A007617 to A049283 (for the case that no such numbers exist, A135347 uses -1 and A049283 uses 0).
All odd numbers not of the form 2^k-1 (i.e. not in A000225) are in this sequence, since uphi(n) = A047994(n) is an even number unless n is a power of 2 (A000079), in this case uphi(n) = n-1.
The intersection of this sequence and A049225 is empty, since for squarefree numbers, all divisors are unitary divisors, note that the intersection of this sequence and A002202 is not empty, the number 110 is in both sequences.

Crossrefs

Programs

  • Mathematica
    Select[Range[135], Length[invUPhi[#]] == 0 &] (* Amiram Eldar, Apr 01 2023, using the function invUPhi from A361966 *)
  • PARI
    A047994(n)=my(f=factor(n)~); prod(i=1, #f, f[1, i]^f[2, i]-1)
    is(n)=for(k=1,n^2,if(A047994(k)==n,return(0)));1 \\ after A047994

Formula

A361967(a(n)) = 0. - Amiram Eldar, Apr 01 2023

A066420 Least m such that card(invphi(phi(m)))=n.

Original entry on oeis.org

1, 3, 5, 15, 13, 51, 37, 41, 35, 65, 187, 397, 2269, 1059, 313, 73, 337, 247, 937, 185, 689, 1139, 2057, 403, 2827, 485, 323, 1321, 3697, 241, 769, 9001, 433, 7129, 4201, 527, 577, 1297, 1201, 15937, 3313, 3281, 3379, 949, 3121, 7519, 3889, 779, 1763
Offset: 2

Views

Author

Vladeta Jovovic, Dec 25 2001

Keywords

Crossrefs

Formula

a(n) = A049283(A007374(n)). - Max Alekseyev, Apr 12 2005

Extensions

More terms from Max Alekseyev, Apr 12 2005

A262599 Lexicographically earliest sequence of distinct terms such that, for any n > 0, phi(a(n)) = phi(n) (where phi denotes the Euler totient function), and a(n) > n if possible.

Original entry on oeis.org

2, 1, 4, 6, 8, 3, 9, 10, 14, 12, 22, 5, 21, 18, 16, 20, 32, 7, 27, 24, 26, 11, 46, 30, 33, 28, 38, 36, 58, 15, 62, 34, 44, 40, 39, 42, 57, 54, 45, 48, 55, 13, 49, 50, 52, 23, 94, 60, 86, 66, 64, 56, 106, 19, 75, 70, 63, 29, 118, 17, 77, 31, 74, 68, 104, 25
Offset: 1

Views

Author

Paul Tek, Sep 25 2015

Keywords

Comments

This is a permutation of the positive integers, with inverse A262603.
If the Carmichael's totient function conjecture is true, then this sequence has no fixed point.
For any n > 0, the orbit of n is finite, with length A066412(n).

Examples

			phi(n) = 6 iff n is in { 7, 9, 14, 18 }.
Hence: a(7) = 9, a(9) = 14, a(14) = 18, a(18) = 7.
		

Crossrefs

Cf. A049283, A066412, A066659, A262603 (inverse).

Programs

  • C
    // See Links section for C program.

Formula

a(n) = max(A066659(n), A049283(A000010(n))), for any n > 0.

A328411 Largest m such that (Z/mZ)* = C_2 X C_(2n), or 0 if no such m exists, where (Z/mZ)* is the multiplicative group of integers modulo m.

Original entry on oeis.org

12, 30, 42, 32, 66, 90, 0, 102, 114, 150, 138, 0, 0, 174, 198, 128, 0, 270, 0, 246, 294, 230, 282, 306, 0, 318, 324, 0, 354, 450, 0, 256, 414, 0, 426, 438, 0, 0, 474, 374, 498, 522, 0, 534, 594, 470, 0, 582, 0, 750, 618, 0, 642, 810, 726, 678, 0, 590, 0, 738, 0, 0, 762, 512
Offset: 1

Views

Author

Jianing Song, Oct 14 2019

Keywords

Comments

It is sufficient to check all numbers in the range [A049283(4n), A057635(4n)] for m if 4n is a totient number.
If (Z/mZ)* is isomorphic to C_2 X C_(2k) for some k, let x be any element in (Z/mZ)* such that the multiplicative order of x is 2k and that x != -1, then {-1, x} generates (Z/mZ)*. For example, (Z/16Z)* = {+-1, +-3, +-9, +-11}, (Z/32Z)* = {+-1, +-3, +-9, +-27, +-17, +-19, +-25, +-11}.

Examples

			The solutions to (Z/mZ)* = C_2 X C_12 are m = 35, 39, 45, 52, 70, 78 and 90, the largest of which is 90, so a(6) = 90.
		

Crossrefs

Cf. A062373, A328410 (largest m).
Cf. also A049283, A057635.

Programs

  • PARI
    a(n) = my(r=4*n, N=floor(exp(Euler)*r*log(log(r^2))+2.5*r/log(log(r^2)))); forstep(k=N, r, -1, if(eulerphi(k)==r && lcm(znstar(k)[2])==r/2, return(k)); if(k==r, return(0)))

A219792 Least k such that phi(k) = lambda(n), or 0 if there is no such k.

Original entry on oeis.org

1, 1, 3, 3, 5, 3, 7, 3, 7, 5, 11, 3, 13, 7, 5, 5, 17, 7, 19, 5, 7, 11, 23, 3, 25, 13, 19, 7, 29, 5, 31, 15, 11, 17, 13, 7, 37, 19, 13, 5, 41, 7, 43, 11, 13, 23, 47, 5, 43, 25, 17, 13, 53, 19, 25, 7, 19, 29, 59, 5, 61, 31, 7, 17, 13, 11, 67, 17, 23, 13, 71, 7
Offset: 1

Views

Author

Michel Lagneau, Nov 28 2012

Keywords

Comments

lambda(n) is the Carmichael lambda function A002322.
a(n) = 0 for n = 209, 297, 413, 418, 517, ...
If a(n) = p is a prime greater than 2, then n belongs to the finite set {p, p1, p2, ..., pk} that is a subsequence of A143417 (see the b-file in A143417). For example:
a(n) = 3 for n = 3, 4, 6;
a(n) = 5 for n = 5, 10, 15, 16, 20, 30, 40, 48, 60, 80, 120, 240;
a(n) = 7 for n = 7, 9, 14, 18, 21, 28, ..., 480;
a(n) = 11 for n = 11, 22, 33, 44, 66, 88, 132, 264;
a(n) = 13 for n = 13, 26, 35, 39, ..., 65520.

Examples

			a(6) = 3 because phi(3) = lambda(6) = 2.
		

Crossrefs

Programs

  • Maple
    with(numtheory): for n from 1 to 100 do: ii:=0:for k from 1 to 10^6 while(ii=0) do:if phi(k)=lambda(n) then ii:=1: printf(`%d, `,k):else fi:od:if ii=0 then printf(`%d, `,0): else fi:od:
  • Mathematica
    Table[k=0;While[!EulerPhi[k]==CarmichaelLambda[n],k++];k,{n,100}]
    Join[{1},Module[{nn=100,ep,lam},ep=Table[{k,EulerPhi[k]},{k,nn}];Table[ SelectFirst[ep,#[[2]]==CarmichaelLambda[n]&],{n,2,nn}]][[All,1]]] (* Harvey P. Dale, Dec 24 2021 *)
  • PARI
    a(n)=my(t=lcm(znstar(n)[2]));if(t>2,for(k=t+1,solve(x=t,2*t^2,x/(exp(Euler)*log(log(x))+3/log(log(x)))-t),if(eulerphi(k)==t,return(k)));0,2*t-1) \\ Charles R Greathouse IV, Nov 28 2012
    
  • 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))))} \\ This function from M. F. Hasler, Oct 05 2009
    A219792(n) = { my(x=lcm(znstar(n)[2])); if(0==A014197(x),0,for(k=1,oo,if(eulerphi(k)==x,return(k)))); }; \\ Antti Karttunen, Dec 05 2017

Formula

a(n) = A049283(A002322(n)).

A380578 Number of nonisomorphic groups appearing as the group of units of the ring Z/kZ for every k such that phi(k) = n.

Original entry on oeis.org

1, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 3, 0, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 4, 0, 0, 0, 3, 0, 0, 0, 3, 0, 1, 0, 1, 0, 1, 0, 3, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 0, 0, 5, 0, 1, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 1, 0, 3, 0, 1, 0, 1, 0, 0, 0, 3, 0, 0, 0
Offset: 1

Views

Author

Miles Englezou, Mar 26 2025

Keywords

Comments

Every group of units is abelian.

Examples

			a(4) = 2 because of the 4 distinct k such that phi(k) = 4 there are 2 nonisomorphic group of units Z/kZ*: C_4, and C_2 x C_2.
a(40) = 3 because of the 9 distinct k such that phi(k) = 40 there are 3 nonisomorphic group of units Z/kZ*: C_40, C_20 x C_2, and C_10 x C_2 x C_2.
a(41) = 0 because there are no k such that phi(k) = 41.
		

Crossrefs

Programs

  • PARI
    groupcount(n) = b=[]; if(n==1, b=concat(b,2), forstep(k=floor(exp(Euler)*n*log(log(n^2))+2.5*n/log(log(n^2))), n, -1, if(eulerphi(k)==n, b=concat(b,k)); if(k==n, b=concat(b,0)))); Z=[]; if(istotient(n)==0, return(0), for(m=2, b[1], if(eulerphi(m)<>n, next, W=[]; U=[]; D=divisors(eulerphi(m)); lambda=lcm(znstar(m)[2]); for(k=1, m-1, if(gcd(k,m)==1, U=concat(U, k))); for(j=1, length(D), if(D[j]>lambda, break); S=[]; for(r=1, eulerphi(m), if(znorder(Mod(U[r], m))==D[j], S=concat(S, U[r]))); W=concat(W, length(S)))); Z=concat(Z,[W]); Z=Set(Z)); return(length(Z)))

Formula

a(n) <= A014197(n).
a(n) = 0 for every n belonging to A007617.
Showing 1-9 of 9 results.