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-7 of 7 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)

A097942 Highly totient numbers: each number k on this list has more solutions to the equation phi(x) = k than any preceding k (where phi is Euler's totient function, A000010).

Original entry on oeis.org

1, 2, 4, 8, 12, 24, 48, 72, 144, 240, 432, 480, 576, 720, 1152, 1440, 2880, 4320, 5760, 8640, 11520, 17280, 25920, 30240, 34560, 40320, 51840, 60480, 69120, 80640, 103680, 120960, 161280, 181440, 207360, 241920, 362880, 483840, 725760, 967680
Offset: 1

Views

Author

Alonso del Arte, Sep 05 2004

Keywords

Comments

If you inspect PhiAnsYldList after running the Mathematica program below, the zeros with even-numbered indices should correspond to the nontotients (A005277).
Where records occur in A014197. - T. D. Noe, Jun 13 2006
Cf. A131934.

Examples

			a(4) = 8 since phi(x) = 8 has the solutions {15, 16, 20, 24, 30}, one more solution than a(3) = 4 for which phi(x) = 4 has solutions {5, 8, 10, 12}.
		

Crossrefs

A subsequence of A007374.

Programs

  • Maple
    HighlyTotientNumbers := proc(n) # n > 1 is search maximum
    local L, m, i, r; L := NULL; m := 0;
    for i from 1 to n do
      r := nops(numtheory[invphi](i));
      if r > m then L := L,[i,r]; m := r fi
    od; [L] end:
    A097942_list := n -> seq(s[1], s = HighlyTotientNumbers(n));
    A097942_list(500); # Peter Luschny, Sep 01 2012
  • Mathematica
    searchMax = 2000; phiAnsYldList = Table[0, {searchMax}]; Do[phiAns = EulerPhi[m]; If[phiAns <= searchMax, phiAnsYldList[[phiAns]]++ ], {m, 1, searchMax^2}]; highlyTotientList = {1}; currHigh = 1; Do[If[phiAnsYldList[[n]] > phiAnsYldList[[currHigh]], highlyTotientList = {highlyTotientList, n}; currHigh = n], {n, 2, searchMax}]; Flatten[highlyTotientList]
  • PARI
    { A097942_list(n) = local(L, m, i, r);
      m = 0;
      for(i=1, n,
    \\ from Max Alekseyev, http://home.gwu.edu/~maxal/gpscripts/
       r = numinvphi(i);
       if(r > m, print1(i,", "); m = r) );
    } \\ Peter Luschny, Sep 01 2012
  • Sage
    def HighlyTotientNumbers(n) : # n > 1 is search maximum.
        R = {}
        for i in (1..n^2) :
            r = euler_phi(i)
            if r <= n :
                R[r] = R[r] + 1 if r in R else 1
        # print R.keys()   # A002202
        # print R.values() # A058277
        P = []; m = 1
        for l in sorted(R.keys()) :
            if R[l] > m : m = R[l]; P.append((l,m))
        # print [l[0] for l in P] # A097942
        # print [l[1] for l in P] # A131934
        return P
    A097942_list = lambda n: [s[0] for s in HighlyTotientNumbers(n)]
    A097942_list(500) # Peter Luschny, Sep 01 2012
    

Extensions

Edited and extended by Robert G. Wilson v, Sep 07 2004

A361971 Record values in A361967.

Original entry on oeis.org

2, 3, 4, 5, 8, 11, 12, 14, 17, 23, 30, 31, 40, 64, 85, 95, 119, 147, 152, 207, 232, 257, 283, 344, 421, 469, 645, 956, 1034, 1306, 1578, 1797, 1943, 2304, 2334, 2877, 3217, 3396, 3536, 3973, 4378, 5171, 5457, 5464, 5659, 7586, 8317, 8430, 10609, 12566, 14469
Offset: 1

Views

Author

Amiram Eldar, Apr 01 2023

Keywords

Crossrefs

The unitary version of A131934.

Programs

  • Mathematica
    solnum[n_] :=  Length[invUPhi[n]]; seq[kmax_] := Module[{s = {}, solmax=0}, Do[sol = solnum[k]; If[sol > solmax, solmax = sol; AppendTo[s, sol]], {k, 1, kmax}]; s]; seq[10^5] (* using the function invUPhi from A361966 *)

Formula

a(n) = A361967(A361968(n)).

Extensions

a(43)-a(51) from Amiram Eldar, Apr 10 2023

A101373 a(n) = A063740(A100827(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 19, 20, 22, 25, 28, 31, 34, 41, 42, 46, 52, 58, 59, 69, 74, 77, 83, 93, 99, 116, 130, 138, 140, 156, 165, 166, 167, 173, 192, 200, 218, 219, 223, 241, 242, 271, 276, 292, 304, 331
Offset: 1

Views

Author

Alonso del Arte, Jan 06 2005

Keywords

Comments

Record values attained by the highly cototient numbers. - Amiram Eldar, Apr 08 2023

Crossrefs

Extensions

More terms from Robert G. Wilson v, Jan 08 2005
Name corrected by Amiram Eldar, Apr 08 2023

A362184 Record values in A362183.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 21, 23, 25, 26, 27, 31, 33, 34, 37, 38, 45, 49, 54, 59, 62, 64, 71, 80, 81, 84, 92, 99, 106, 122, 137, 145, 147, 167, 174, 180, 183, 203, 211, 231, 232, 251, 253, 283, 289, 306, 318, 342, 362, 378, 410, 412, 453
Offset: 1

Views

Author

Amiram Eldar, Apr 10 2023

Keywords

Crossrefs

The unitary version of A101373.
Similar sequences: A131934, A361971.

Programs

  • Mathematica
    ucototient[n_] := n - Times @@ (Power @@@ FactorInteger[n] - 1); ucototient[1] = 0; With[{max = 300}, solnum = Table[0, {n, 1, max}]; Do[If[(i = ucototient[k]) <= max, solnum[[i]]++], {k, 2, max^2}]; s = {1}; solmax=1; Do[sol = solnum[[k]]; If[sol > solmax, solmax = sol; AppendTo[s, sol]], {k, 2, max}]; s]

Formula

a(n) = A362181(A362183(n)).

A362403 Number of times that the number A362402(n) occurs as a sum of divisors that have a square factor (A162296).

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 9, 10, 13, 15, 16, 20, 22, 23, 28, 34, 46, 53, 60, 62, 78, 81, 113, 115, 122, 132, 154, 184, 185, 222, 248, 254, 343, 346, 350, 354, 497, 569, 701, 711, 860, 941, 1088, 1221, 1222, 1235, 1263, 1306, 1572, 1721, 1737, 1948, 2191, 2315, 2418, 2877
Offset: 1

Views

Author

Amiram Eldar, Apr 18 2023

Keywords

Crossrefs

Similar sequences: A131934, A101373, A206027, A238896.

Programs

  • Mathematica
    s[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; Times @@ ((p^(e + 1) - 1)/(p - 1)) - Times @@ (p + 1)]; s[1] = 0; seq[max_] := Module[{v = Select[Array[s, max], 0 < # <= max &], sq = {0}, t, tmax = 0}, t = Sort[Tally[v]]; Do[If[t[[k]][[2]] > tmax, tmax = t[[k]][[2]]; AppendTo[sq, t[[k]][[2]]]], {k, 1, Length[t]}]; sq]; seq[10^5]
  • PARI
    s(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; ((p^(e + 1) - 1)/(p - 1))) -  prod(i = 1, #f~, f[i, 1] + 1);}
    lista(kmax) = {my(v = vector(kmax), vmax = 0, i); for(k=1, kmax, i = s(k); if(i > 0 && i <= kmax, v[i]++)); print1(0, ", "); for(k=1, kmax, if(v[k] > vmax, vmax = v[k]; print1(v[k], ", "))); }

A362488 Record values in A362487.

Original entry on oeis.org

2, 4, 6, 10, 14, 18, 22, 30, 34, 40, 48, 58, 60, 92, 136, 146, 184, 232, 240, 342, 478, 518, 638, 772, 830, 924, 1080, 1264, 1330, 1340, 1462, 1824, 2132, 2528, 2710, 3224, 3354, 4084, 4672, 4812, 4976, 5912, 6496, 7606, 8230, 8698, 11472, 12354, 16580, 19250
Offset: 1

Views

Author

Amiram Eldar, Apr 22 2023

Keywords

Crossrefs

Similar sequences: A101373, A131934, A361971, A362184.

Programs

  • Mathematica
    solnum[n_] := Length[invIPhi[n]]; seq[kmax_] := Module[{s = {}, solmax=0}, Do[sol = solnum[k]; If[sol > solmax, solmax = sol; AppendTo[s, sol]], {k, 1, kmax}]; s]; seq[10^4] (* using the function invIPhi from A362484 *)

Formula

a(n) = A362485(A362487(n)).
Showing 1-7 of 7 results.