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 24 results. Next

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

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

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)

A006511 Largest inverse of totient function (A000010): a(n) is the largest x such that phi(x) = m, where m = A002202(n) is the n-th number in the range of phi.

Original entry on oeis.org

2, 6, 12, 18, 30, 22, 42, 60, 54, 66, 46, 90, 58, 62, 120, 126, 150, 98, 138, 94, 210, 106, 162, 174, 118, 198, 240, 134, 142, 270, 158, 330, 166, 294, 276, 282, 420, 250, 206, 318, 214, 378, 242, 348, 354, 462, 254, 510, 262, 414, 274, 278, 426, 630, 298, 302
Offset: 1

Keywords

Comments

Always even, as phi(2n) = phi(n) when n is odd. - Alain Jacques (thegentleway(AT)bigpond.com), Jun 15 2006

References

  • J. W. L. Glaisher, Number-Divisor Tables. British Assoc. Math. Tables, Vol. 8, Camb. Univ. Press, 1940, p. 64.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

For records see A036913, A132154, A036912.

Programs

  • Mathematica
    phiinv[n_, pl_] := Module[{i, p, e, pe, val}, If[pl=={}, Return[If[n==1, {1}, {}]]]; val={}; p=Last[pl]; For[e=0; pe=1, e==0||Mod[n, (p-1)pe/p]==0, e++; pe*=p, val=Join[val, pe*phiinv[If[e==0, n, n*p/pe/(p-1)], Drop[pl, -1]]]]; Sort[val]]; phiinv[n_] := phiinv[n, Select[1+Divisors[n], PrimeQ]]; Last/@Select[phiinv/@Range[1, 200], #!={}&] (* phiinv[n, pl] = list of x with phi(x)=n and all prime divisors of x in list pl. phiinv[n] = list of x with phi(x)=n *)
  • PARI
    g(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)))); \\ A057635
    lista(nn) = for(m = 1, nn, if(istotient(m), print1(g(m), ", "))); \\ Jinyuan Wang, Aug 29 2019
    
  • PARI
    lista(nmax) = my(s); for(n = 1, nmax, s = invphiMax(n); if(s > 0, print1(s, ", "))); \\ Amiram Eldar, Nov 14 2024, using Max Alekseyev's invphi.gp
  • Perl
    use ntheory ":all"; my $k=1; for my $i (1..100) { my @v; do{@v=inverse_totient($k++)} until @v; print "$i $v[-1]\n"; } # Dana Jacobsen, Mar 04 2019
    

Formula

a(n) = A057635(A002202(n)). - T. D. Noe

A032446 Number of solutions to phi(k) = 2n.

Original entry on oeis.org

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

Author

Ursula Gagelmann (gagelmann(AT)altavista.net)

Keywords

Comments

By Carmichael's conjecture, a(n) <> 1 for any n. See A074987. - Thomas Ordowski, Sep 13 2017
a(n) = 0 iff n is a term of A079695. - Bernard Schott, Oct 02 2021

Examples

			If n = 8 then phi(x) = 2*8 = 16 is satisfied for only a(8) = 6 values of x, viz. 17, 32, 34, 40, 48, 60.
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, The Queen of Mathematics Entertains, Second Edition, Dover Publications, Inc., NY, 1966, page 90.

Crossrefs

Bisection of A014197.
Cf. A006511 (largest k for which A000010(k) = A002202(n)), A057635.

Programs

  • Magma
    [#EulerPhiInverse( 2*n):n in [1..100]]; // Marius A. Burtea, Sep 08 2019
    
  • Maple
    with(numtheory); [ seq(nops(invphi(2*n)), n=1..90) ];
  • Mathematica
    t = Table[0, {100} ]; Do[a = EulerPhi[n]; If[a < 202, t[[a/2]]++ ], {n, 3, 10^5} ]; t
  • PARI
    a(n) = invphiNum(2*n); \\ Amiram Eldar, Nov 15 2024 using Max Alekseyev's invphi.gp

Extensions

Extended by Robin Trew (trew(AT)hcs.harvard.edu).

A049283 a(n) is the smallest k such that phi(k) = n, where phi is Euler's totient function, or a(n) = 0 if no such k exists.

Original entry on oeis.org

1, 3, 0, 5, 0, 7, 0, 15, 0, 11, 0, 13, 0, 0, 0, 17, 0, 19, 0, 25, 0, 23, 0, 35, 0, 0, 0, 29, 0, 31, 0, 51, 0, 0, 0, 37, 0, 0, 0, 41, 0, 43, 0, 69, 0, 47, 0, 65, 0, 0, 0, 53, 0, 81, 0, 87, 0, 59, 0, 61, 0, 0, 0, 85, 0, 67, 0, 0, 0, 71, 0, 73, 0, 0, 0, 0, 0, 79, 0, 123, 0, 83, 0, 129, 0, 0, 0, 89
Offset: 1

Author

Jud McCranie, Oct 10 2000

Keywords

Examples

			The smallest k such that phi(k) = 2 is k = 3, so a(2) = 3.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=140,ep},ep=Table[{k,EulerPhi[k]},{k,0,nn}];Table[SelectFirst[ep,#[[2]]==n&],{n,nn}]][[;;,1]]/."NotFound"->0 (* Harvey P. Dale, Jul 29 2023 *)
  • PARI
    a(n)=if(n>2,for(k=n+1,solve(x=n,2*n^2,x/(exp(Euler)*log(log(x))+3/log(log(x)))-n),if(eulerphi(k)==n,return(k)));0,2*n-1) \\ Charles R Greathouse IV, Nov 28 2012
    
  • PARI
    x=1000;v=vector(x\(exp(Euler)*log(log(x))+3/log(log(x)))); for(n=1,x,t=eulerphi(n); if(t<=#v && !v[t], v[t]=n)); v \\ Charles R Greathouse IV, Nov 28 2012
    
  • PARI
    a(n) = max(0, invphiMin(n)); \\ Amiram Eldar, Nov 15 2024, using Max Alekseyev's invphi.gp

A057826 Greatest number with totient 2n (or zero when no such number exists).

Original entry on oeis.org

6, 12, 18, 30, 22, 42, 0, 60, 54, 66, 46, 90, 0, 58, 62, 120, 0, 126, 0, 150, 98, 138, 94, 210, 0, 106, 162, 174, 118, 198, 0, 240, 134, 0, 142, 270, 0, 0, 158, 330, 166, 294, 0, 276, 0, 282, 0, 420, 0, 250, 206, 318, 214, 378, 242, 348, 0, 354, 0, 462, 0, 0, 254, 510
Offset: 1

Author

Robert G. Wilson v, Nov 08 2000

Keywords

Comments

If a(n) = 0, n is a nontotient number - see (A005277)/2.

Crossrefs

Bisection of A057635. Cf. A000010, A005277, A002181.

Programs

  • Mathematica
    a = Table[0, {100}]; Do[ t = EulerPhi[n]/2; If[t < 101, a[[t]] = n], {n, 1, 10^3}]; a
  • PARI
    a(n) = invphiMax(2*n); \\ Amiram Eldar, Nov 11 2024, using Max Alekseyev's invphi.gp

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

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

A319048 a(n) is the greatest k such that A000010(k) divides n where A000010 is the Euler totient function.

Original entry on oeis.org

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

Author

Michel Marcus, Sep 09 2018

Keywords

Comments

Sándor calls this function the totient maximum function and remarks that this function is well-defined, since a(n) can be at least 2, and cannot be greater than n^2 (when n > 6).

Crossrefs

Cf. A000010 (Euler totient), A061026 (the totient minimum function).
Cf. A319068 (the analog for the sum of divisors).
Right border of A378638.

Programs

  • Mathematica
    a[n_] := Module[{kmax = If[n <= 6, 10 n, n^2]}, For[k = kmax, True, k--, If[Divisible[n, EulerPhi[k]], Return[k]]]];
    Array[a, 80] (* Jean-François Alcover, Sep 17 2018, from PARI *)
  • PARI
    a(n) = {my(kmax = if (n<=6, 10*n, n^2)); forstep (k=kmax, 1, -1, if ((n % eulerphi(k)) == 0, return (k)););}
    
  • PARI
    \\ (The first two functions could probably be combined in a smarter way):
    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))))} \\ From A014197 by M. F. Hasler
    A057635(n) = if(1==n,2,if((n%2),0,my(k=A014197(n),i=n); if(!k, 0, while(k, i++; if(eulerphi(i)==n, k--)); (i))));
    A319048(n) = { my(m=0); fordiv(n,d, m = max(m,A057635(d))); (m); }; \\ Antti Karttunen, Sep 09 2018
    
  • PARI
    a(n) = {my(d = divisors(n)); vecmax(vector(#d, i, invphiMax(d[i])));} \\ Amiram Eldar, Nov 29 2024, using Max Alekseyev's invphi.gp

Formula

a(n) = Max_{d|n} A057635(d). - Antti Karttunen, Sep 09 2018

A317993 Number of k such that (Z/kZ)* is isomorphic to (Z/nZ)*, where (Z/nZ)* is the multiplicative group of integers modulo n.

Original entry on oeis.org

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

Author

Jianing Song, Oct 03 2018

Keywords

Comments

To find solutions for k to (Z/kZ)* = (Z/nZ)*, it's sufficient to check for A015126(n) <= k <= A028476(n).
It seems that this sequence is unbounded. For example, there are 59 solutions to (Z/nZ)* = C_2 X C_6 X C_1260.
Conjecture: Every number occurs in this sequence.

Examples

			The solutions to (Z/kZ)* = C_6 are k = 7, 9, 14 and 18, so a(7) = a(9) = a(14) = a(18) = 4.
The solutions to (Z/kZ)* = C_2 X C_20 are k = 55, 75, 100, 110 and 150, so a(55) = a(75) = a(100) = a(110) = a(150) = 5.
The solutions to (Z/kZ)* = C_2 X C_12 are k = 35, 39, 45, 52, 70, 78 and 90, so a(35) = a(39) = a(45) = a(52) = a(70) = a(78) = a(90) = 7.
		

Crossrefs

Earliest occurrence of m is A303712(m).

Programs

  • PARI
    a(n) = if(abs(n)==1||abs(n)==2, 2, my(i=0, search_max = A057635(eulerphi(n))); for(j=eulerphi(n)+1, search_max, if(znstar(j)[2]==znstar(n)[2], i++)); i) \\ search_max is the largest k such that phi(k) = phi(n). See A057635 for its program

A112720 Numbers m such that phi(m) = 1^d_1 + 2^d_2 + ... + k^d_k where d_1 d_2 ... d_k is the decimal expansion of m.

Original entry on oeis.org

1, 2, 6883, 1132856, 11059812
Offset: 1

Author

Farideh Firoozbakht, Sep 17 2005

Keywords

Comments

There is no further term up to 7*10^7.
a(6) > 10^12. - Giovanni Resta, Apr 13 2017
This sequence is full because for k > 10 and 10^k <= m < 10^(k+1), phi(m) > 10^k/f(10^k) > Sum_{i=1..k+1} i^9 >= Sum_{i=1..k+1} i^d_i, where f(n) = exp(gamma)*log(log(n)) + 2.5/log(log(n)) is given in A057635. - Jinyuan Wang, Aug 02 2020

Examples

			phi(11059812) = 1^1 + 2^1 + 3^0 + 4^5 + 5^9 + 6^8 + 7^1 + 8^2 so 11059812 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Do[d=IntegerDigits[n];k=Length[d];If[EulerPhi[n]==Sum[j^d[[j]], {j, k}], Print[n]], {n, 70000000}]
Showing 1-10 of 24 results. Next