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

A023900 Dirichlet inverse of Euler totient function (A000010).

Original entry on oeis.org

1, -1, -2, -1, -4, 2, -6, -1, -2, 4, -10, 2, -12, 6, 8, -1, -16, 2, -18, 4, 12, 10, -22, 2, -4, 12, -2, 6, -28, -8, -30, -1, 20, 16, 24, 2, -36, 18, 24, 4, -40, -12, -42, 10, 8, 22, -46, 2, -6, 4, 32, 12, -52, 2, 40, 6, 36, 28, -58, -8, -60, 30, 12, -1, 48, -20, -66, 16, 44, -24, -70, 2, -72, 36, 8, 18, 60, -24, -78, 4, -2
Offset: 1

Views

Author

Keywords

Comments

Also called reciprocity balance of n.
Apart from different signs, same as Sum_{d divides n} core(d)*mu(n/d), where core(d) (A007913) is the squarefree part of d. - Benoit Cloitre, Apr 06 2002
Main diagonal of A191898. - Mats Granvik, Jun 19 2011

Examples

			x - x^2 - 2*x^3 - x^4 - 4*x^5 + 2*x^6 - 6*x^7 - x^8 - 2*x^9 + 4*x^10 - ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 37.
  • D. M. Burton, Elementary Number Theory, Allyn and Bacon Inc. Boston, MA, 1976, p. 125.

Crossrefs

Moebius transform is A055615.
Cf. A027748, A173557 (gives the absolute values), A295876.
Cf. A253905 (Dgf at s=3).

Programs

  • Haskell
    a023900 1 = 1
    a023900 n = product $ map (1 -) $ a027748_row n
    -- Reinhard Zumkeller, Jun 01 2015
    
  • Maple
    A023900 := n -> mul(1-i,i=numtheory[factorset](n)); # Peter Luschny, Oct 26 2010
  • Mathematica
    a[ n_] := If[ n < 1, 0, Sum[ d MoebiusMu @ d, { d, Divisors[n]}]] (* Michael Somos, Jul 18 2011 *)
    Array[ Function[ n, 1/Plus @@ Map[ #*MoebiusMu[ # ]/EulerPhi[ # ]&, Divisors[ n ] ] ], 90 ]
    nmax = 81; Drop[ CoefficientList[ Series[ Sum[ MoebiusMu[k] k x^k/(1 - x^k), {k, 1, nmax} ], {x, 0, nmax} ], x ], 1 ] (* Stuart Clary, Apr 15 2006 *)
    t[n_, 1] = 1; t[1, k_] = 1; t[n_, k_] :=  t[n, k] = If[n < k, If[n > 1 && k > 1, Sum[-t[k - i, n], {i, 1, n - 1}], 0], If[n > 1 && k > 1, Sum[-t[n - i, k], {i, 1, k - 1}], 0]]; Table[t[n, n], {n, 36}] (* Mats Granvik, Robert G. Wilson v, Jun 25 2011 *)
    Table[DivisorSum[m, # MoebiusMu[#] &], {m, 90}] (* Jan Mangaldan, Mar 15 2013 *)
    f[p_, e_] := (1 - p); a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Oct 14 2020 *)
  • PARI
    {a(n) = direuler( p=2, n, (1 - p*X) / (1 - X))[n]}
    
  • PARI
    {a(n) = if( n<1, 0, sumdiv( n, d, d * moebius(d)))} /* Michael Somos, Jul 18 2011 */
    
  • PARI
    a(n)=sumdivmult(n,d, d*moebius(d)) \\ Charles R Greathouse IV, Sep 09 2014
    
  • Python
    from sympy import divisors, mobius
    def a(n): return sum([d*mobius(d) for d in divisors(n)]) # Indranil Ghosh, Apr 29 2017
    
  • Python
    from math import prod
    from sympy import primefactors
    def A023900(n): return prod(1-p for p in primefactors(n)) # Chai Wah Wu, Sep 08 2023
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A023900 n) (if (= 1 n) 1 (* (- 1 (A020639 n)) (A023900 (A028234 n))))) ;; Antti Karttunen, Nov 28 2017

Formula

a(n) = Sum_{ d divides n } d*mu(d) = Product_{p|n} (1-p).
a(n) = 1 / (Sum_{ d divides n } mu(d)*d/phi(d)).
Dirichlet g.f.: zeta(s)/zeta(s-1). - Michael Somos, Jun 04 2000
a(n+1) = det(n+1)/det(n) where det(n) is the determinant of the n X n matrix M_(i, j) = i/gcd(i, j) = lcm(i, j)/j. - Benoit Cloitre, Aug 19 2003
a(n) = phi(n)*moebius(A007947(n))*A007947(n)/n. Logarithmic g.f.: Sum_{n >= 1} a(n)*x^n/n = log(F(x)) where F(x) is the g.f. of A117209 and satisfies: 1/(1-x) = Product_{n >= 1} F(x^n). - Paul D. Hanna, Mar 03 2006
G.f.: A(x) = Sum_{k >= 1} mu(k) k x^k/(1 - x^k) where mu(k) is the Moebius (Mobius) function, A008683. - Stuart Clary, Apr 15 2006
G.f.: A(x) is x times the logarithmic derivative of A117209(x). - Stuart Clary, Apr 15 2006
Row sums of triangle A134842. - Gary W. Adamson, Nov 12 2007
G.f.: x/(1-x) = Sum_{n >= 1} a(n)*x^n/(1-x^n)^2. - Paul D. Hanna, Aug 16 2008
a(n) = phi(rad(n)) *(-1)^omega(n) = A000010(A007947(n)) *(-1)^A001221(n). - Enrique Pérez Herrero, Aug 24 2010
a(n) = Product_{i = 2..n} (1-i)^( (pi(i)-pi(i-1)) * floor( (cos(n*Pi/i))^2 ) ), where pi = A000720, Pi = A000796. - Wesley Ivan Hurt, May 24 2013
a(n) = -limit of zeta(s)*(Sum_{d divides n} moebius(d)/exp(d)^(s-1)) as s->1 for n>1. - Mats Granvik, Jul 31 2013
a(n) = Sum_{d divides n} mu(d)*rad(d), where rad is A007947. - Enrique Pérez Herrero, May 29 2014
Conjecture for n>1: Let n = 2^(A007814(n))*m = 2^(ruler(n))*odd_part(n), where m = A000265(n), then a(n) = (-1)^(m=n)*(0+Sum_{i=1..m and gcd(i,m)=1} (4*min(i,m-i)-m)) = (-1)^(m1} (4*min(i,m-i)-m)). - I. V. Serov, May 02 2017
a(n) = (-1)^A001221(n) * A173557(n). - R. J. Mathar, Nov 02 2017
a(1) = 1; for n > 1, a(n) = (1-A020639(n)) * a(A028234(n)), because multiplicative with a(p^e) = (1-p). - Antti Karttunen, Nov 28 2017
a(n) = 1 - Sum_{d|n, d > 1} d*a(n/d). - Ilya Gutkovskiy, Apr 26 2019
From Richard L. Ollerton, May 07 2021: (Start)
For n>1, Sum_{k=1..n} a(gcd(n,k)) = 0.
For n>1, Sum_{k=1..n} a(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)) = 0. (End)
a(n) = rad(n)*(-1)^omega(n)*phi(n)/n = A062953(n)*A000010(n)/n. - Amrit Awasthi, Jan 30 2022
a(n) = mu(n)*phi(n) = A008683(n)*A000010(n) whenever n is squarefree. - Amrit Awasthi, Feb 03 2022
From Peter Bala, Jan 24 2024: (Start)
a(n) = Sum_{d divides n} core(d)*mu(d). Cf. Comment by Benoit Cloitre, dated Apr 06 2002.
a(n) = Sum_{d|n, e|n} n/gcd(d, e) * mu(n/d) * mu(n/e) (the sum is a multiplicative function of n by Tóth, and takes the value 1 - p for n = p^e, a prime power). (End)
From Peter Bala, Feb 01 2024: (Start)
G.f. Sum_{n >= 1} (2*n-1)*moebius(2*n-1)*x^(2*n-1)/(1 + x^(2n-1)).
a(n) = (-1)^(n+1) * Sum_{d divides n, d odd} d*moebius(d). (End)

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
    

A002088 Sum of totient function: a(n) = Sum_{k=1..n} phi(k), cf. A000010.

Original entry on oeis.org

0, 1, 2, 4, 6, 10, 12, 18, 22, 28, 32, 42, 46, 58, 64, 72, 80, 96, 102, 120, 128, 140, 150, 172, 180, 200, 212, 230, 242, 270, 278, 308, 324, 344, 360, 384, 396, 432, 450, 474, 490, 530, 542, 584, 604, 628, 650, 696, 712, 754, 774, 806, 830, 882, 900, 940, 964
Offset: 0

Views

Author

Keywords

Comments

Number of elements in the set {(x,y): 1 <= x <= y <= n, 1=gcd(x,y)}. - Michael Somos, Jun 13 1999
Sum_{k=1..n} phi(k) gives the number of distinct arithmetic progressions which contain an infinite number of primes and whose difference does not exceed n. E.g., {1k+1}, {2k+1}, {3k+1, 3k+2}, {4k+1, 4k+3}, {5k+1, ..5k+4} means 10 sequences. - Labos Elemer, May 02 2001
The quotient A024916(n)/a(n) = SummatorySigma/SummatoryTotient as n increases seems to approach Pi^4/36 = zeta(2)^2 = A098198 ~2.705808084277845. - Labos Elemer, Sep 20 2004 (corrected by Peter Pein, Apr 28 2009)
Also the number of rationals p/q in (0,1] with denominators q<=n. - Franz Vrabec, Jan 29 2005
a(n) is the number of initial segments of Beatty sequences for real numbers > 1, cut off when the next term in the sequence would be >= n. For example, the sequence 1,2 is included for n=3 and n=4, but not for n >= 5 because the next term of the Beatty sequence must be 3 or 4. Problem suggested by David W. Wilson. - Franklin T. Adams-Watters, Oct 19 2006
Number of complex numbers satisfying any one of {x^1=1, x^2=1, x^3=1, x^4=1, x^5=1, ..., x^n=1}. - Paul Smith (math.idiot(AT)gmail.com), Mar 19 2007
a(n+2) equals the number of Sturmian words of length n which are 'special', prefix of two Sturmian words of length n+1. - Fred Lunnon, Sep 05 2010
For n > 1: A020652(a(n)) = 1 and A038567(a(n)) = n; for n > 0: A214803(a(n)) = 1. - Reinhard Zumkeller, Jul 29 2012
Also number of elements in the set {(x,y): 1 <= x + y <= n, x >= 0, y > 0, with x and y relatively prime integers}. Thus, the number of reduced rational numbers x/y with x nonnegative, y positive, and x + y <= n. (For n >= 1, 0 <= x/y <= n - 1, clearly including each integer in this interval.) - Rick L. Shepherd, Apr 08 2014
This function, the partial sums of phi = A000010, is sometimes denoted by (uppercase) Phi. - M. F. Hasler, Apr 18 2015
From Roger Ford, Jan 16 2016: (Start)
For n >= 1: a(n) is the number of perfect arched semi-meander solutions with n arches. To be perfect the number of arch groupings must equal the number of arches with a length of 1 in the current generation and every preceding generation.
Example: p is the number of arches with length 1 (/\), g is the number of arch groups (-), n is number of arches in the top half of a semi-meander solution
/\
/\ //\\
//\\-/\-///\\\- n=6 p=3 g=3 Each preceding arch configuration
/\ /\ is formed by attaching the arch
/\-//\\-//\\- n=5 p=3 g=3 end in the first position and the
/\ arch end in the last position.
//\\
///\\\-/\- n=4 p=2 g=2
/\
//\\-/\- n=3 p=2 g=2
/\-/\- n=2 p=2 g=2
/\- n=1 p=1 g=1. (End)
a(n) is the number of distinct lists of binary words of length n that are balanced (Sturmian). - Dan Rockwell, Will Wodrich, Aaliyah Fiala, and Bob Burton, May 30 2019
2013 IMO Problem 6 shows that a(n) is the number of ways to arrange the numbers 0, 1, ..., n on a circle such that for any numbers 0 <= a < b < c < d <= n, the chord joining a and d does not intersect with the chord intersecting b and c, with rotation counted as same. - Yifan Xie, Aug 26 2025

Examples

			G.f. = x + 2*x^2 + 4*x^3 + 6*x^4 + 10*x^5 + 12*x^6 + 18*x^7 + 22*x^8 + 28*x^9 + ...
		

References

  • A. Beiler, Recreations in the Theory of Numbers, Dover Publications, 1966, Chap. XVI.
  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 115-119.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 138.
  • M. N. Huxley, The Distribution of Prime Numbers, Oxford Univ. Press, 1972, p. 6.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-10.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section I.21.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 94, Problem 11.
  • 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).
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 111.

Crossrefs

Programs

  • GAP
    List([1..60],n->Sum([1..n],i->Phi(i))); # Muniru A Asiru, Jul 31 2018
    
  • Haskell
    a002088 n = a002088_list !! n
    a002088_list = scanl (+) 0 a000010_list -- Reinhard Zumkeller, Jul 29 2012
    
  • Magma
    [&+[EulerPhi(i): i in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Aug 01 2018
    
  • Maple
    with(numtheory): A002088:=n->add(phi(i),i=1..n): seq(A002088(n), n=0..70);
  • Mathematica
    Table[Plus @@ EulerPhi[Range[n]], {n, 0, 57}] (* Alonso del Arte, May 30 2006 *)
    Accumulate[EulerPhi[Range[0,60]]] (* Harvey P. Dale, Aug 27 2011 *)
  • PARI
    a(n)=sum(k=1,n,eulerphi(k)) \\ Charles R Greathouse IV, Jun 16 2011
    
  • PARI
    a(n)=my(s=1); forsquarefree(k=1,n,s+=(n\k[1])^2*moebius(k)); s/2 \\ Charles R Greathouse IV, Oct 15 2021
    
  • PARI
    first(n)=my(v=vector(n),s); forfactored(k=1,n, v[k[1]]=s+=eulerphi(k)); v \\ Charles R Greathouse IV, Oct 15 2021
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A002088(n): # based on second formula in A018805
        if n == 0:
            return 0
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(2*A002088(k1)-1)
            j, k1 = j2, n//j2
        return (n*(n-1)-c+j)//2 # Chai Wah Wu, Mar 24 2021
  • Sage
    [sum(euler_phi(k) for k in (1..n)) for n in (0..60)] # G. C. Greubel, Nov 25 2018
    

Formula

a(n) = (3*n^2)/(Pi^2) + O(n log n).
More precisely, a(n) = (3/Pi^2)*n^2 + O(n*(log(n))^(2/3)*(log(log(n)))^(4/3)), (A. Walfisz 1963). - Benoit Cloitre, Feb 02 2003
a(n) = (1/2)*Sum_{k>=1} mu(k)*floor(n/k)*floor(1+n/k). - Benoit Cloitre, Apr 11 2003
a(n) = A000217(n) - A063985(n) = A018805(n) - A015614(n). - Reinhard Zumkeller, Jan 21 2013
A slightly simpler version of Cloitre's formula is a(n) = 1/2 + Sum_{k=1..oo} floor(n/k)^2*mu(k)/2. - Bill Gosper, Jul 25 2020
The quotient A024916(n)/a(n) = SummatorySigma/SummatoryTotient as n increases seems to approach (Pi^4)/36 = Zeta(2)^2 = 2.705808084277845. See also A067282. - Labos Elemer, Sep 21 2004
A024916(n)/a(n) = zeta(2)^2 + O(log(n)/n). This follows from asymptotic formulas for the sequences. - Franklin T. Adams-Watters, Oct 19 2006
Row sums of triangle A134542. - Gary W. Adamson, Oct 31 2007
G.f.: (Sum_{n>=1} mu(n)*x^n/(1-x^n)^2)/(1-x), where mu(n) = A008683(n). - Mamuka Jibladze, Apr 06 2015
a(n) = A005728(n) - 1, for n >= 0. - Wolfdieter Lang, Nov 22 2016
a(n) = (Sum_{k=1..floor(sqrt(n))} k*(k+1) * (M(floor(n/k)) - M(floor(n/(k+1)))) + Sum_{k=1..floor(n/(1+floor(sqrt(n))))} mu(k) * floor(n/k) * floor(1+n/k))/2, where M(k) is the Mertens function (A002321) and mu(k) is the Moebius function (A008683). - Daniel Suteu, Nov 23 2018
a(n) = A015614(n)+1. - R. J. Mathar, Apr 26 2023
a(n) = A000217(n) - Sum{k=2..n} a(floor(n/k)). From summing over Id = 1 (Dirichlet convolution) phi. - Jason Xu, Jul 31 2024
a(n) = Sum_{k=1..n} k*A002321(floor(n/k)). - Ridouane Oudra, Jul 03 2025

Extensions

Additional comments from Len Smiley

A020492 Balanced numbers: numbers k such that phi(k) (A000010) divides sigma(k) (A000203).

Original entry on oeis.org

1, 2, 3, 6, 12, 14, 15, 30, 35, 42, 56, 70, 78, 105, 140, 168, 190, 210, 248, 264, 270, 357, 418, 420, 570, 594, 616, 630, 714, 744, 812, 840, 910, 1045, 1240, 1254, 1485, 1672, 1848, 2090, 2214, 2376, 2436, 2580, 2730, 2970, 3080, 3135, 3339, 3596, 3720, 3828
Offset: 1

Views

Author

Keywords

Comments

The quotient A020492(n)/A002088(n) = SummatorySigma/SummatoryTotient as n increases seems to approach Pi^4/36 or zeta(2)^2 [~2.705808084277845]. - Labos Elemer, Sep 20 2004, corrected by Charles R Greathouse IV, Jun 20 2012
If 2^p-1 is prime (a Mersenne prime) then m = 2^(p-2)*(2^p-1) is in the sequence because when p = 2 we get m = 3 and phi(3) divides sigma(3) and for p > 2, phi(m) = 2^(p-2)*(2^(p-1)-1); sigma(m) = (2^(p-1)-1)*2^p hence sigma(m)/phi(m) = 4 is an integer. So for each n, A133028(n) = 2^(A000043(n)-2)*(2^A000043(n)-1) is in the sequence. - Farideh Firoozbakht, Nov 28 2005
Phi and sigma are both multiplicative functions and for this reason if m and n are coprime and included in this sequence then m*n is also in this sequence. - Enrique Pérez Herrero, Sep 05 2010
The quotients sigma(n)/phi(n) are in A023897. - Bernard Schott, Jun 06 2017
There are 544768 balanced numbers < 10^14. - Jud McCranie, Sep 10 2017
a(975807) = 419998185095132. - Jud McCranie, Nov 28 2017

Examples

			sigma(35) = 1+5+7+35 = 48, phi(35) = 24, hence 35 is a term.
		

References

  • D. Chiang, "N's for which phi(N) divides sigma(N)", Mathematical Buds, Chap. VI pp. 53-70 Vol. 3 Ed. H. D. Ruderman, Mu Alpha Theta 1984.

Crossrefs

Positions of 0's in A063514.

Programs

  • Magma
    [ n: n in [1..3900] | SumOfDivisors(n) mod EulerPhi(n) eq 0 ]; // Klaus Brockhaus, Nov 09 2008
    
  • Mathematica
    Select[ Range[ 4000 ], IntegerQ[ DivisorSigma[ 1, # ]/EulerPhi[ # ] ]& ]
    (* Second program: *)
    Select[Range@ 4000, Divisible[DivisorSigma[1, #], EulerPhi@ #] &] (* Michael De Vlieger, Nov 28 2017 *)
  • PARI
    select(n->sigma(n)%eulerphi(n)==0,vector(10^4,i,i)) \\ Charles R Greathouse IV, Jun 20 2012
    
  • Python
    from sympy import totient, divisor_sigma
    print([n for n in range(1, 4001) if divisor_sigma(n)%totient(n)==0]) # Indranil Ghosh, Jul 06 2017
    
  • Python
    from math import prod
    from itertools import count, islice
    from sympy import factorint
    def A020492_gen(startvalue=1): # generator of terms >= startvalue
        for m in count(max(startvalue,1)):
            f = factorint(m)
            if not prod(p**(e+2)-p for p,e in f.items())%(m*prod((p-1)**2 for p in f)):
                yield m
    A020492_list = list(islice(A020492_gen(),20)) # Chai Wah Wu, Aug 12 2024

Extensions

More terms from Farideh Firoozbakht, Nov 28 2005

A023022 Number of partitions of n into two relatively prime parts. After initial term, this is the "half-totient" function phi(n)/2 (A000010(n)/2).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 3, 2, 5, 2, 6, 3, 4, 4, 8, 3, 9, 4, 6, 5, 11, 4, 10, 6, 9, 6, 14, 4, 15, 8, 10, 8, 12, 6, 18, 9, 12, 8, 20, 6, 21, 10, 12, 11, 23, 8, 21, 10, 16, 12, 26, 9, 20, 12, 18, 14, 29, 8, 30, 15, 18, 16, 24, 10, 33, 16, 22, 12, 35, 12, 36, 18, 20, 18, 30, 12, 39, 16, 27, 20, 41, 12
Offset: 2

Views

Author

Keywords

Comments

The number of distinct linear fractional transformations of order n. Also the half-totient function can be used to construct a tree containing all the integers. On the zeroth rank we have just the integers 1 and 2: immediate "ancestors" of 1 and 2 are (1: 3,4,6 2: 5,8,10,12) etc. - Benoit Cloitre, Jun 03 2002
Moebius transform of floor(n/2). - Paul Barry, Mar 20 2005
Also number of different kinds of regular n-gons, one convex, the others self-intersecting. - Reinhard Zumkeller, Aug 20 2005
From Artur Jasinski, Oct 28 2008: (Start)
Degrees of minimal polynomials of cos(2*Pi/n). The first few are
1: x - 1
2: x + 1
3: 2*x + 1
4: x
5: 4*x^2 + 2*x - 1
6: 2*x - 1
7: 8*x^3 + 4*x^2 - 4*x - 1
8: 2*x^2 - 1
9: 8*x^3 - 6*x + 1
10: 4*x^2 - 2*x - 1
11: 32*x^5 + 16*x^4 - 32*x^3 - 12*x^2 + 6*x + 1
These polynomials have solvable Galois groups, so their roots can be expressed by radicals. (End)
a(n) is the number of rationals p/q in the interval [0,1] such that p + q = n. - Geoffrey Critzer, Oct 10 2011
It appears that, for n > 2, a(n) = A023896(n)/n. Also, it appears that a record occurs at n > 2 in this sequence if and only if n is a prime. For example, records occur at n=5, 7, 11, 13, 17, ..., all of which are prime. - John W. Layman, Mar 26 2012
From Wolfdieter Lang, Dec 19 2013: (Start)
a(n) is the degree of the algebraic number of s(n)^2 = (2*sin(Pi/n))^2, starting at a(1)=1. s(n) = 2*sin(Pi/n) is the length ratio side/R for a regular n-gon inscribed in a circle of radius R (in some length units). For the coefficient table of the minimal polynomials of s(n)^2 see A232633.
Because for even n, s(n)^2 lives in the algebraic number field Q(rho(n/2)), with rho(k) = 2*cos(Pi/k), the degree is a(2*l) = A055034(l). For odd n, s(n)^2 is an integer in Q(rho(n)), and the degree is a(2*l+1) = A055034(2*l+1) = phi(2*l+1)/2, l >= 1, with Euler's totient phi=A000010 and a(1)=1. See also A232631-A232633.
(End)
Also for n > 2: number of fractions A182972(k)/A182973(k) such that A182972(k) + A182973(k) = n, A182972(n) and A182973(n) provide an enumeration of positive rationals < 1 arranged by increasing sum of numerator and denominator then by increasing numerator. - Reinhard Zumkeller, Jul 30 2014
Number of distinct rectangles with relatively prime length and width such that L + W = n, W <= L. For a(17)=8; the rectangles are 1 X 16, 2 X 15, 3 X 14, 4 X 13, 5 X 12, 6 X 11, 7 X 10, 8 X 9. - Wesley Ivan Hurt, Nov 12 2017
After including a(1) = 1, the number of elements of any reduced residue system mod* n used by Brändli and Beyne is a(n). See the examples below. - Wolfdieter Lang, Apr 22 2020
a(n) is the number of ABC triples with n = c. - Felix Huber, Oct 12 2023

Examples

			a(15)=4 because there are 4 partitions of 15 into two parts that are relatively prime: 14 + 1, 13 + 2, 11 + 4, 8 + 7. - _Geoffrey Critzer_, Jan 25 2015
The smallest nonnegative reduced residue system mod*(n) for n = 1 is {0}, hence a(1) = 1; for n = 9 it is {1, 2, 4}, because 5 == 4 (mod* 9) since -5 == 4 (mod 9), 7 == 2 (mod* 9) and 8 == 1 (mod* 9). Hence a(9) = phi(9)/2 = 3. See the comment on Brändli and Beyne above. - _Wolfdieter Lang_, Apr 22 2020
		

References

  • G. Pólya and G. Szegő, Problems and Theorems in Analysis I (Springer 1924, reprinted 1972), Part Eight, Chap. 1, Sect. 6, Problems 60&61.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a023022 n = length [(u, v) | u <- [1 .. div n 2],
                                 let v = n - u, gcd u v == 1]
    -- Reinhard Zumkeller, Jul 30 2014
    
  • Magma
    [1] cat [EulerPhi(n)/ 2: n in [3..100]]; // Vincenzo Librandi, Aug 19 2018
  • Maple
    A023022 := proc(n)
        if n =2 then
            1;
        else
            numtheory[phi](n)/2 ;
        end if;
    end proc:
    seq(A023022(n),n=2..60) ; # R. J. Mathar, Sep 19 2017
  • Mathematica
    Join[{1}, Table[EulerPhi[n]/2, {n, 3, 100}]] (* adapted by Vincenzo Librandi, Aug 19 2018 *)
  • PARI
    a(n)=if(n<=2,1,eulerphi(n)/2);
    /* for printing minimal polynomials of cos(2*Pi/n) */
    default(realprecision,110);
    for(n=1,33,print(n,": ",algdep(cos(2*Pi/n),a(n))));
    
  • Python
    from sympy.ntheory import totient
    def a(n): return 1 if n<3 else totient(n)/2 # Indranil Ghosh, Mar 30 2017
    

Formula

a(n) = phi(n)/2 for n >= 3.
a(n) = (1/n)*Sum_{k=1..n-1, gcd(n, k)=1} k = A023896(n)/n for n>2. - Reinhard Zumkeller, Aug 20 2005
G.f.: x*(x - 1)/2 + (1/2)*Sum_{k>=1} mu(k)*x^k/(1 - x^k)^2. - Ilya Gutkovskiy, Apr 13 2017
a(n) = Sum_{d|n} moebius(n/d)*floor(d/2). - Michel Marcus, May 25 2021

Extensions

This was in the 1973 "Handbook", but then was dropped from the database. Resubmitted by David W. Wilson
Entry revised by N. J. A. Sloane, Jun 10 2012
Polynomials edited with the consent of Artur Jasinski by Wolfdieter Lang, Jan 08 2011
Name clarified by Geoffrey Critzer, Jan 25 2015

A001088 Product of totient function: a(n) = Product_{k=1..n} phi(k) (cf. A000010).

Original entry on oeis.org

1, 1, 1, 2, 4, 16, 32, 192, 768, 4608, 18432, 184320, 737280, 8847360, 53084160, 424673280, 3397386240, 54358179840, 326149079040, 5870683422720, 46965467381760, 563585608581120, 5635856085811200, 123988833887846400, 991910671102771200, 19838213422055424000
Offset: 0

Views

Author

Keywords

Comments

a(n) is also the determinant of the symmetric n X n matrix M defined by M(i,j) = gcd(i,j) for 1 <= i,j <= n [Smith and Mansion]. - Avi Peretz (njk(AT)netvision.net.il), Mar 20 2001
The matrix M(i,j) = gcd(i,j) is sequence A003989. - Michael Somos, Jun 25 2012

Examples

			a(2) = 1 because the matrix M is: [1,1; 1,2] and det(A) = 1.
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 2, p. 598.
  • M. Petkovsek et al., A=B, Peters, 1996, p. 21.

Crossrefs

Programs

Formula

a(n) = phi(1) * phi(2) * ... * phi(n).
Limit_{n->infinity} a(n)^(1/n) / n = exp(-1) * A124175 = 0.205963050288186353879675428232497466485878059342058515016427881513657493... (see Mathoverflow link). - Vaclav Kotesovec, Jun 09 2021

Extensions

a(0)=1 prepended by Alois P. Heinz, Jul 19 2023

A061255 Euler transform of Euler totient function phi(n), cf. A000010.

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 21, 37, 60, 98, 157, 251, 392, 612, 943, 1439, 2187, 3293, 4930, 7330, 10839, 15935, 23315, 33933, 49170, 70914, 101861, 145713, 207638, 294796, 417061, 588019, 826351, 1157651, 1616849, 2251623, 3126775, 4330271, 5981190
Offset: 0

Views

Author

Vladeta Jovovic, Apr 21 2001

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 20; b = Table[EulerPhi[n], {n, nn}]; CoefficientList[Series[Product[1/(1 - x^m)^b[[m]], {m, nn}], {x, 0, nn}], x] (* T. D. Noe, Jun 19 2012 *)

Formula

G.f.: Product_{k>=1} (1 - x^k)^(-phi(k)).
a(n) = 1/n*Sum_{k=1..n} a(n-k)*b(k), n>1, a(0)=1, b(k) = Sum_{d|k} d*phi(d), cf. A057660.
Logarithmic derivative yields A057660 (equivalent to above formula). - Paul D. Hanna, Sep 05 2012
a(n) ~ exp(3^(4/3) * Zeta(3)^(1/3) * n^(2/3) / (2^(1/3) * Pi^(2/3)) - 1/6) * A^2 * Zeta(3)^(1/9) / (2^(4/9) * 3^(7/18) * Pi^(8/9) * n^(11/18)), where A is the Glaisher-Kinkelin constant A074962. - Vaclav Kotesovec, Mar 23 2018
G.f.: exp(Sum_{k>=1} (sigma_2(k^2)/sigma_1(k^2)) * x^k/k). - Ilya Gutkovskiy, Apr 22 2019

A081373 Number of values of k, 1 <= k <= n, with phi(k) = phi(n), where phi is Euler totient function, A000010.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Mar 24 2003

Keywords

Comments

Ordinal transform of Euler totient function phi, A000010. - Antti Karttunen, Aug 26 2024

Examples

			For n = 16: phi(k) = {1,1,2,2,4,2,6,4,6,4,10,4,12,6,8,8} for k = 1,...,n; 2 numbers exist with phi(k) = phi(n) = 8: {15,16}, so a(16) = 2.
If n = p is an odd prime number, then a(p) = 1 with phi(k) = p-1.
		

Crossrefs

Cf. A000010, A081375 (positions of records), A210719 (of 1's).
Cf. also A067004, A303756, A303757, A303777 (ordinal transform of this sequence).

Programs

  • Mathematica
    f[x_] := Count[Table[EulerPhi[j]-EulerPhi[x], {j, 1, x}], 0] Table[f[w], {w, 1, 100}]
  • PARI
    a(n)=my(t=eulerphi(n), s); sum(k=1, n, eulerphi(k)==t) \\ Charles R Greathouse IV, Feb 21 2013, corrected by Antti Karttunen, Aug 26 2024
    
  • PARI
    a(n) = #select(x -> x <= n, invphi(eulerphi(n))); \\ Amiram Eldar, Nov 08 2024, using Max Alekseyev's invphi.gp

A053575 Odd part of phi(n): a(n) = A000265(A000010(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 5, 1, 3, 3, 1, 1, 1, 3, 9, 1, 3, 5, 11, 1, 5, 3, 9, 3, 7, 1, 15, 1, 5, 1, 3, 3, 9, 9, 3, 1, 5, 3, 21, 5, 3, 11, 23, 1, 21, 5, 1, 3, 13, 9, 5, 3, 9, 7, 29, 1, 15, 15, 9, 1, 3, 5, 33, 1, 11, 3, 35, 3, 9, 9, 5, 9, 15, 3, 39, 1, 27, 5, 41, 3, 1, 21, 7, 5, 11, 3, 9, 11, 15, 23
Offset: 1

Views

Author

Labos Elemer, Jan 18 2000

Keywords

Comments

This is not necessarily the squarefree kernel. E.g., for n=19, phi(19)=18 is divisible by 9, an odd square. Values at which this kernel is 1 correspond to A003401 (polygons constructible with ruler and compass).
Multiplicative with a(2^e) = 1, a(p^e) = p^(e-1)*A000265(p-1). - Christian G. Bower, May 16 2005

Examples

			n = 70 = 2*5*7, phi(70) = 24 = 8*3, so the odd kernel of phi(70) is a(70)=3. [corrected by _Bob Selcoe_, Aug 22 2017]
From _Bob Selcoe_, Aug 22 2017: (Start)
a(89) = 88/8 = 11.
For n = 8820, 8820 = 2^2*3^2*5*7^2; S = 3*5*7 = 105, n" = 3^2*5*7^2 = 2205. a(3)*a(5)*a(7) = 1*1*3 = 3; a(8820) = 3*2205/105 = 63.
(End)
		

Crossrefs

Programs

  • Haskell
    a053575 = a000265 . a000010  -- Reinhard Zumkeller, Oct 09 2013
  • Maple
    a:= n-> (t-> t/2^padic[ordp](t, 2))(numtheory[phi](n)):
    seq(a(n), n=1..80);  # Alois P. Heinz, Apr 14 2020
  • Mathematica
    Array[NestWhile[Ceiling[#/2] &, EulerPhi@ #, EvenQ] &, 94] (* Michael De Vlieger, Aug 22 2017 *) (* or *)
    t=Array[EulerPhi,94]; t/2^IntegerExponent[t,2] (* Giovanni Resta, Aug 23 2017 *)
  • PARI
    a(n)=n=eulerphi(n);n>>valuation(n,2) \\ Charles R Greathouse IV, Mar 05 2013
    

Formula

From Bob Selcoe, Aug 22 2017: (Start)
Let n" be the odd part of n, S be the odd squarefree kernel of n and p_i {i = 1..z} be all the prime factors of S. Then the sequence can be constructed by the following:
a(1) = 1;
a(n) = (n-1)" when n is prime; and
a(n) = Product_{i = 1..z} a(p_i)*n"/S when n is composite (see Examples).
(End)
From Antti Karttunen, Dec 27 2020: (Start)
a(n) = A336466(n) for squarefree n (see A005117).
A336466(a(n)) = A336468(n), A329697(a(n)) = A336469(n) = A329697(n) - A005087(n).
(End)

A034380 Ratio of totient to Carmichael's lambda function: a(n) = A000010(n) / A002322(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 4, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 4, 1, 2, 1, 2, 2, 1, 1, 4, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 4, 1, 1, 6, 2, 4, 2, 1, 2, 2, 2, 1, 4, 1, 1, 2, 2, 2, 2, 1, 8, 1, 1, 1, 4, 4, 1, 2, 4, 1, 2, 6, 2, 2, 1, 2, 4, 1, 1, 2, 2, 1, 2, 1, 4, 4
Offset: 1

Views

Author

Keywords

Comments

a(n)=1 if and only if the multiplicative group modulo n is cyclic (that is, if n is either 1, 2, 4, or of the form p^k or 2*p^k where p is an odd prime). In other words: a(n)=1 if n is a term of A033948, otherwise a(n) > 1 (and n is a term of A033949). - Joerg Arndt, Jul 14 2012

Crossrefs

Programs

Formula

a(n) = A000010(n) / A002322(n).
a(A033948(n)) = 1 [Banks & Luca]. - R. J. Mathar, Jul 29 2007
A002322(n)/A007947(a(n)) = A289624(n). - Antti Karttunen, Jul 17 2017
Showing 1-10 of 4244 results. Next