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

A018805 Number of elements in the set {(x,y): 1 <= x,y <= n, gcd(x,y)=1}.

Original entry on oeis.org

1, 3, 7, 11, 19, 23, 35, 43, 55, 63, 83, 91, 115, 127, 143, 159, 191, 203, 239, 255, 279, 299, 343, 359, 399, 423, 459, 483, 539, 555, 615, 647, 687, 719, 767, 791, 863, 899, 947, 979, 1059, 1083, 1167, 1207, 1255, 1299, 1391, 1423, 1507, 1547, 1611, 1659, 1763
Offset: 1

Views

Author

Keywords

Comments

Number of positive rational numbers of height at most n, where the height of p/q is max(p, q) when p and q are relatively prime positive integers. - Charles R Greathouse IV, Jul 05 2012
The number of ordered pairs (i,j) with 1<=i<=n, 1<=j<=n, gcd(i,j)=d is a(floor(n/d)). - N. J. A. Sloane, Jul 29 2012
Equals partial sums of A140434 (1, 2, 4, 4, 8, 4, 12, 8, ...) and row sums of triangle A143469. - Gary W. Adamson, Aug 17 2008
Number of distinct solutions to k*x+h=0, where 1 <= k,h <= n. - Giovanni Resta, Jan 08 2013
a(n) is the number of rational numbers which can be constructed from the set of integers between 1 and n, without combination of multiplication and division. a(3) = 7 because {1, 2, 3} can only create {1/3, 1/2, 2/3, 1, 3/2, 2, 3}. - Bernard Schott, Jul 07 2019

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 110-112.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954. See Theorem 332.

Crossrefs

Cf. A177853 (partial sums).
The main diagonal of A331781, also of A333295.

Programs

  • Haskell
    a018805 n = length [()| x <- [1..n], y <- [1..n], gcd x y == 1]
    -- Reinhard Zumkeller, Jan 21 2013
    
  • Magma
    /* based on the first formula */ A018805:=func< n | 2*&+[ EulerPhi(k): k in [1..n] ]-1 >; [ A018805(n): n in [1..60] ]; // Klaus Brockhaus, Jan 27 2011
    
  • Magma
    /* based on the second formula */ A018805:=func< n | n eq 1 select 1 else n^2-&+[ $$(n div j): j in [2..n] ] >; [ A018805(n): n in [1..60] ]; // Klaus Brockhaus, Feb 07 2011
    
  • Maple
    N:= 1000; # to get the first N entries
    P:= Array(1..N,numtheory:-phi);
    A:= map(t -> 2*round(t)-1, Statistics:-CumulativeSum(P));
    convert(A,list); # Robert Israel, Jul 16 2014
  • Mathematica
    FoldList[ Plus, 1, 2 Array[ EulerPhi, 60, 2 ] ] (* Olivier Gérard, Aug 15 1997 *)
    Accumulate[2*EulerPhi[Range[60]]]-1 (* Harvey P. Dale, Oct 21 2013 *)
  • PARI
    a(n)=sum(k=1,n,moebius(k)*(n\k)^2)
    
  • PARI
    A018805(n)=2 *sum(j=1, n, eulerphi(j)) - 1;
    for(n=1, 99, print1(A018805(n), ", ")); /* show terms */
    
  • PARI
    a(n)=my(s); forsquarefree(k=1,n, s+=moebius(k)*(n\k[1])^2); s \\ Charles R Greathouse IV, Jan 08 2018
    
  • Python
    from sympy import sieve
    def A018805(n): return 2*sum(t for t in sieve.totientrange(1,n+1)) - 1 # Chai Wah Wu, Mar 23 2021
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A018805(n): # based on second formula
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A018805(k1)
            j, k1 = j2, n//j2
        return n*(n-1)-c+j # Chai Wah Wu, Mar 24 2021

Formula

a(n) = 2*(Sum_{j=1..n} phi(j)) - 1.
a(n) = n^2 - Sum_{j=2..n} a(floor(n/j)).
a(n) = 2*A015614(n) + 1. - Reinhard Zumkeller, Apr 08 2006
a(n) = 2*A002088(n) - 1. - Hugo van der Sanden, Nov 22 2008
a(n) ~ (1/zeta(2)) * n^2 = (6/Pi^2) * n^2 as n goes to infinity (zeta is the Riemann zeta function, A013661, and the constant 6/Pi^2 is 0.607927..., A059956). - Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 18 2001
a(n) ~ 6*n^2/Pi^2 + O(n*log n). - N. J. A. Sloane, May 31 2020
a(n) = Sum_{k=1..n} mu(k)*floor(n/k)^2. - Benoit Cloitre, May 11 2003
a(n) = A000290(n) - A100613(n) = A015614(n) + A002088(n). - Reinhard Zumkeller, Jan 21 2013
a(n) = A242114(floor(n/k),1), 1<=k<=n; particularly a(n) = A242114(n,1). - Reinhard Zumkeller, May 04 2014
a(n) = 2 * A005728(n) - 3. - David H Post, Dec 20 2016
a(n) ~ 6*n^2/Pi^2, cf. A059956. [Hardy and Wright] - M. F. Hasler, Jan 20 2017
G.f.: (1/(1 - x)) * (-x + 2 * Sum_{k>=1} mu(k) * x^k / (1 - x^k)^2). - Ilya Gutkovskiy, Feb 14 2020

Extensions

More terms from Reinhard Zumkeller, Apr 08 2006
Link to Moree's paper corrected by Peter Luschny, Aug 08 2009

A082540 Number of ordered quadruples (a,b,c,d) with gcd(a,b,c,d)=1 (1 <= {a,b,c,d} <= n).

Original entry on oeis.org

1, 15, 79, 239, 607, 1199, 2303, 3823, 6223, 9279, 13919, 19183, 27007, 35743, 47519, 60735, 78719, 97103, 122447, 148527, 181839, 216959, 262543, 306863, 365343, 423855, 495855, 569055, 661679, 748527, 862047, 972191, 1104831, 1237247
Offset: 1

Views

Author

Benoit Cloitre, May 11 2003

Keywords

Crossrefs

Column k=4 of A344527.
Cf. A015634.

Programs

  • PARI
    a(n)=sum(k=1,n,moebius(k)*floor(n/k)^4)
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A082540(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A082540(k1)
            j, k1 = j2, n//j2
        return n*(n**3-1)-c+j # Chai Wah Wu, Mar 29 2021

Formula

a(n) = Sum_{k=1..n} mu(k)*floor(n/k)^4.
a(n) is asymptotic to c*n^4 with c=0.92393....
Lim_{n->infinity} a(n)/n^4 = 1/zeta(4) = A215267 = 90/Pi^4. - Karl-Heinz Hofmann, Apr 11 2021
Lim_{n->infinity} n^4/a(n) = zeta(4) = A013662 = Pi^4/90. - Karl-Heinz Hofmann, Apr 11 2021
a(n) = n^4 - Sum_{k=2..n} a(floor(n/k)). - Seiichi Manyama, Sep 13 2024

A100448 Number of triples (i,j,k) with 1 <= i <= j < k <= n and gcd{i,j,k} = 1.

Original entry on oeis.org

0, 1, 4, 9, 19, 30, 51, 73, 106, 140, 195, 241, 319, 388, 480, 572, 708, 813, 984, 1124, 1310, 1485, 1738, 1926, 2216, 2462, 2777, 3059, 3465, 3749, 4214, 4590, 5060, 5484, 6048, 6474, 7140, 7671, 8331, 8899, 9719, 10289, 11192, 11902, 12754, 13535, 14616
Offset: 1

Views

Author

N. J. A. Sloane, Nov 21 2004

Keywords

Comments

Probably the partial sums of A102309. - Ralf Stephan, Jan 03 2005

Crossrefs

Programs

  • Maple
    f:=proc(n) local i,j,k,t1,t2,t3; t1:=0; for i from 1 to n do for j from i to n do t2:=gcd(i,j); for k from j+1 to n do t3:=gcd(t2,k); if t3 = 1 then t1:=t1+1; fi; od: od: od: t1; end;
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[ If[ GCD[i, j, k] == 1, {i, j, k}], {i, n}, {j, i, n}, {k, j + 1, n}], 2]]]; Table[ If[n > 3, f[n] - 1, f[n]], {n, 47}] (* Robert G. Wilson v, Dec 14 2004 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A100448(n):
        if n == 0:
            return 0
        c, j = 2, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(6*A100448(k1)+1)
            j, k1 = j2, n//j2
        return (n*(n**2-1)-c+j)//6 # Chai Wah Wu, Mar 29 2021

Formula

a(n) = (A071778(n)-1)/6. - Vladeta Jovovic, Nov 30 2004
a(n) = (1/6)*(-1 + Sum_{k=1..n} moebius(k)*floor(n/k)^3). - Ralf Stephan, Jan 03 2005

Extensions

More terms from Robert G. Wilson v, Dec 14 2004
Edited by N. J. A. Sloane, Sep 06 2008 at the suggestion of R. J. Mathar

A090025 Number of distinct lines through the origin in 3-dimensional cube of side length n.

Original entry on oeis.org

0, 7, 19, 49, 91, 175, 253, 415, 571, 805, 1033, 1423, 1723, 2263, 2713, 3313, 3913, 4825, 5491, 6625, 7513, 8701, 9811, 11461, 12637, 14497, 16045, 18043, 19807, 22411, 24163, 27133, 29485, 32425, 35065, 38593, 41221, 45433, 48727, 52831
Offset: 0

Views

Author

Joshua Zucker, Nov 25 2003

Keywords

Comments

Equivalently, lattice points where the GCD of all coordinates = 1.

Examples

			a(2) = 19 because the 19 points with at least one coordinate=2 all make distinct lines and the remaining 7 points and the origin are on those lines.
		

Crossrefs

Cf. A000225, A001047, A060867, A090020, A090021, A090022, A090023, A090024 are for n dimensions with side length 1, 2, 3, 4, 5, 6, 7, 8, respectively. A049691, A090025, A090026, A090027, A090028, A090029 are this sequence for 2, 3, 4, 5, 6, 7 dimensions. A090030 is the table for n dimensions, side length k.
Cf. A071778.

Programs

  • Mathematica
    aux[n_, k_] := If[k == 0, 0, (k + 1)^n - k^n - Sum[aux[n, Divisors[k][[i]]], {i, 1, Length[Divisors[k]] - 1}]];lines[n_, k_] := (k + 1)^n - Sum[Floor[k/i - 1]*aux[n, i], {i, 1, Floor[k/2]}] - 1;Table[lines[3, k], {k, 0, 40}]
    a[n_] := Sum[MoebiusMu[k]*((Floor[n/k]+1)^3-1), {k, 1, n}]; Table[a[n], {n, 0, 39}] (* Jean-François Alcover, Nov 28 2013, after Vladeta Jovovic *)
  • PARI
    a(n)=(n+1)^3-sum(j=2,n+1,a(floor(n/j)))
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A090025(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A090025(k1)
            j, k1 = j2, n//j2
        return (n+1)**3-c+7*(j-n-1) # Chai Wah Wu, Mar 30 2021

Formula

a(n) = A090030(3, n).
a(n) = Sum_{k=1..n} moebius(k)*((floor(n/k)+1)^3-1). - Vladeta Jovovic, Dec 03 2004
a(n) = (n+1)^3 - Sum_{j=2..n+1} a(floor(n/j)). - Seth A. Troisi, Aug 29 2013
a(n) = 6*A015631(n) + 1 for n>=1. - Hugo Pfoertner, Mar 30 2021

A015631 Number of ordered triples of integers from [ 1..n ] with no global factor.

Original entry on oeis.org

1, 3, 8, 15, 29, 42, 69, 95, 134, 172, 237, 287, 377, 452, 552, 652, 804, 915, 1104, 1252, 1450, 1635, 1910, 2106, 2416, 2674, 3007, 3301, 3735, 4027, 4522, 4914, 5404, 5844, 6432, 6870, 7572, 8121, 8805, 9389, 10249, 10831, 11776, 12506
Offset: 1

Views

Author

Keywords

Comments

Number of integer-sided triangles with at least two sides <= n and sides relatively prime. - Henry Bottomley, Sep 29 2006

Examples

			a(4) = 15 because the 15 triples in question are in lexicographic order: [1,1,1], [1,1,2], [1,1,3], [1,1,4], [1,2,2], [1,2,3], [1,2,4], [1,3,3], [1,3,4], [1,4,4], [2,2,3], [2,3,3], [2,3,4], [3,3,4] and [3,4,4]. - _Wolfdieter Lang_, Apr 04 2013
The a(4) = 15 triangles with at least two sides <= 4 and sides relatively prime (see _Henry Bottomley_'s comment above) are: [1,1,1], [1,2,2], [2,2,3], [1,3,3], [2,3,3], [2,3,4], [3,3,4], [3,3,5], [1,4,4], [2,4,5], [3,4,4], [3,4,5], [3,4,6], [4,4,5], [4,4,7]. - _Alois P. Heinz_, Feb 14 2020
		

Crossrefs

Programs

  • Magma
    [n eq 1 select 1 else Self(n-1)+ &+[MoebiusMu(n div d) *d*(d+1)/2:d in Divisors(n)]:n in [1..50]]; // Marius A. Burtea, Feb 14 2020
    
  • Maple
    with(numtheory):
    b:= proc(n) option remember;
           add(mobius(n/d)*d*(d+1)/2, d=divisors(n))
        end:
    a:= proc(n) option remember;
          b(n) + `if`(n=1, 0, a(n-1))
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Feb 09 2011
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Sum[MoebiusMu[n/d]*d*(d+1)/2, {d, Divisors[n]}] + a[n-1]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Jan 20 2014, after Maple *)
    Accumulate[Table[Sum[MoebiusMu[n/d]*d*(d + 1)/2, {d, Divisors[n]}], {n, 1, 50}]] (* Vaclav Kotesovec, Jan 31 2019 *)
  • PARI
    a(n) = sum(k=1, n, sumdiv(k, d, moebius(k/d)*binomial(d+1, 2))); \\ Seiichi Manyama, Jun 12 2021
    
  • PARI
    a(n) = binomial(n+2, 3)-sum(k=2, n, a(n\k)); \\ Seiichi Manyama, Jun 12 2021
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, moebius(k)*x^k/(1-x^k)^3)/(1-x)) \\ Seiichi Manyama, Jun 12 2021
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A015631(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A015631(k1)
            j, k1 = j2, n//j2
        return n*(n-1)*(n+4)//6-c+j # Chai Wah Wu, Mar 30 2021
    

Formula

a(n) = (A071778(n)+3*A018805(n)+2)/6. - Vladeta Jovovic, Dec 01 2004
Partial sums of the Moebius transform of the triangular numbers (A007438). - Steve Butler, Apr 18 2006
a(n) = 2*A123324(n) - A046657(n) for n>1. - Henry Bottomley, Sep 29 2006
Row sums of triangle A134543. - Gary W. Adamson, Oct 31 2007
a(n) ~ n^3 / (6*Zeta(3)). - Vaclav Kotesovec, Jan 31 2019
G.f.: (1/(1 - x)) * Sum_{k>=1} mu(k) * x^k / (1 - x^k)^3. - Ilya Gutkovskiy, Feb 14 2020
a(n) = n*(n+1)*(n+2)/6 - Sum_{j=2..n} a(floor(n/j)) = A000292(n) - Sum_{j=2..n} a(floor(n/j)). - Chai Wah Wu, Mar 30 2021

A343978 Number of ordered 6-tuples (a,b,c,d,e,f) with gcd(a,b,c,d,e,f)=1 (1<= {a,b,c,d,e,f} <= n).

Original entry on oeis.org

1, 63, 727, 4031, 15559, 45863, 116855, 257983, 526615, 983583, 1755143, 2935231, 4776055, 7407727, 11256623, 16498719, 23859071, 33434063, 46467719, 62949975, 84644439, 111486599, 146142583, 187854119, 240880239, 303814503, 382049919, 473813703, 586746719
Offset: 1

Views

Author

Karl-Heinz Hofmann, May 06 2021

Keywords

References

  • Joachim von zur Gathen and Jürgen Gerhard, Modern Computer Algebra, Cambridge University Press, Second Edition 2003, pp. 53-54.

Crossrefs

Programs

  • PARI
    a(n)={sum(k=1, n+1, moebius(k)*(n\k)^6)} \\ Andrew Howroyd, May 08 2021
    
  • Python
    from labmath import mobius
    def A343978(n): return sum(mobius(k)*(n//k)**6 for k in range(1, n+1))
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A343978(n):
        if n == 0:
            return 0
        c, j, k1 = 1, 2, n//2
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A343978(k1)
            j, k1 = j2, n//j2
        return n*(n**5-1)-c+j # Chai Wah Wu, May 17 2021

Formula

a(n) = Sum_{k=1..n} mu(k)*floor(n/k)^6.
Lim_{n->infinity} a(n)/n^6 = 1/zeta(6) = A343359 = 945/Pi^6.
a(n) = n^6 - Sum_{k=2..n} a(floor(n/k)). - Seiichi Manyama, Sep 13 2024

Extensions

Edited by N. J. A. Sloane, Jun 13 2021

A082544 Number of ordered quintuples (a,b,c,d,e) with gcd(a,b,c,d,e)=1 (1<= {a,b,c,d,e} <= n).

Original entry on oeis.org

1, 31, 241, 991, 3091, 7501, 16531, 31711, 57781, 96601, 157651, 240031, 362491, 519961, 739201, 1012441, 1383721, 1822711, 2409241, 3091441, 3966301, 4974751, 6257461, 7680781, 9481681, 11474941, 13916191, 16610371, 19911151, 23435191
Offset: 1

Views

Author

Benoit Cloitre, May 11 2003

Keywords

Crossrefs

Column k=5 of A344527.
Cf. A018805 (pairs), A071778 (triples), A082540 (quadruples), A343978.
Cf. A015650.

Programs

  • PARI
    a(n)=sum(k=1,n,moebius(k)*floor(n/k)^5)
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A082544(n):
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A082544(k1)
            j, k1 = j2, n//j2
        return n*(n**4-1)-c+j # Chai Wah Wu, Mar 29 2021

Formula

a(n) = Sum_{k=1..n} mu(k)*floor(n/k)^5; a(n) is asymptotic to c*n^5 with c=0.9643....
Lim_{n->infinity} a(n)/n^5 = 1/zeta(5) = A343308. - Karl-Heinz Hofmann, Apr 11 2021
Lim_{n->infinity} n^5/a(n) = zeta(5) = A013663. - Karl-Heinz Hofmann, Apr 11 2021
a(n) = n^5 - Sum_{k=2..n} a(floor(n/k)). - Seiichi Manyama, Sep 13 2024

A342586 a(n) is the number of pairs (x,y) with 1 <= x, y <= 10^n and gcd(x,y)=1.

Original entry on oeis.org

1, 63, 6087, 608383, 60794971, 6079301507, 607927104783, 60792712854483, 6079271032731815, 607927102346016827, 60792710185772432731, 6079271018566772422279, 607927101854119608051819, 60792710185405797839054887, 6079271018540289787820715707, 607927101854027018957417670303
Offset: 0

Views

Author

Karl-Heinz Hofmann, Mar 16 2021

Keywords

References

  • Joachim von zur Gathen and Jürgen Gerhard, Modern Computer Algebra, Cambridge University Press, Second Edition 2003, pp. 53-54. (See link below.)

Crossrefs

a(n) = 2*A064018(n) - 1. - Hugo Pfoertner, Mar 16 2021
a(n) = A018805(10^n). - Michel Marcus, Mar 16 2021
Related counts of k-tuples:
triples: A071778, A342935, A342841;
quadruples: A082540, A343527, A343193;
5-tuples: A343282;
6-tuples: A343978, A344038. - N. J. A. Sloane, Jun 13 2021

Programs

  • PARI
    a342586(n)=my(s, m=10^n); forfactored(k=1,m,s+=eulerphi(k)); s*2-1 \\ Bruce Garner, Mar 29 2021
    
  • PARI
    a342586(n)=my(s, m=10^n); forsquarefree(k=1,m,s+=moebius(k)*(m\k[1])^2); s \\ Bruce Garner, Mar 29 2021
  • Python
    import math
    for n in range (0,10):
         counter = 0
         for x in range (1, pow(10,n)+1):
            for y in range(1, pow(10,n)+1):
                if math.gcd(y,x) ==  1:
                    counter += 1
         print(n, counter)
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A018805(n):
      if n == 1: return 1
      return n*n - sum(A018805(n//j) for j in range(2, n//2+1)) - (n+1)//2
    print([A018805(10**n) for n in range(8)]) # Michael S. Branicky, Mar 18 2021
    

Formula

Lim_{n->infinity} a(n)/10^(2*n) = 6/Pi^2 = 1/zeta(2).

Extensions

a(10) from Michael S. Branicky, Mar 18 2021
More terms using A064018 from Hugo Pfoertner, Mar 18 2021
Edited by N. J. A. Sloane, Jun 13 2021

A344522 a(n) = Sum_{1 <= i, j, k <= n} gcd(i,j,k).

Original entry on oeis.org

1, 9, 30, 76, 141, 267, 400, 624, 885, 1249, 1590, 2208, 2689, 3411, 4248, 5248, 6081, 7485, 8530, 10248, 11889, 13687, 15228, 17988, 20053, 22569, 25242, 28588, 31053, 35463, 38284, 42540, 46581, 50893, 55362, 61824, 65857, 71247, 76884, 84388, 89349, 97881, 103342
Offset: 1

Views

Author

Seiichi Manyama, May 22 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[EulerPhi[k] * Quotient[n, k]^3, {k, 1, n}]; Array[a, 50] (* Amiram Eldar, May 22 2021 *)
  • PARI
    a(n) = sum(i=1, n, sum(j=1, n, sum(k=1, n, gcd([i, j, k]))));
    
  • PARI
    a(n) = sum(k=1, n, eulerphi(k)*(n\k)^3);
    
  • PARI
    my(N=66, x='x+O('x^N)); Vec(sum(k=1, N, eulerphi(k)*x^k*(1+4*x^k+x^(2*k))/(1-x^k)^3)/(1-x))

Formula

a(n) = Sum_{k=1..n} phi(k) * floor(n/k)^3.
G.f.: (1/(1 - x)) * Sum_{k >= 1} phi(k) * x^k * (1 + 4*x^k + x^(2*k))/(1 - x^k)^3.
a(n) ~ Pi^2 * n^3 / (6*zeta(3)). - Vaclav Kotesovec, May 23 2021

A342841 Number of ordered triples (x, y, z) with gcd(x, y, z) = 1 and 1 <= {x, y, z} <= 10^n.

Original entry on oeis.org

1, 841, 832693, 832046137, 831916552903, 831908477106883, 831907430687799769, 831907383078281024371, 831907373418800027750413, 831907372722449100147414487, 831907372589073124899487831735, 831907372581823023465031521920149, 831907372580768386561159867257319711
Offset: 0

Views

Author

Karl-Heinz Hofmann, Mar 24 2021

Keywords

Examples

			For visualization, the set(x, y, z) is inscribed in a cube matrix.
"o" stands for a gcd = 1.
"." stands for a gcd > 1.
.
For n=1, the size of the cube matrix is 10 X 10 X 10:
.
                         / : : : : : : : : : :
                        /                               100 Sum (z = 1)
                z = 7 |/1 2 3 4 5 6 7 8 9 10             |
                    --+---------------------             75 Sum (z = 2)
                   1 /| o o o o o o o o o o    10        |
                   2/ | o o o o o o o o o o    10        91 Sum (z = 3)
                   /                           10        |
           z = 8 |/1 2 3 4 5 6 7 8 9 10        10       75 Sum (z = 4)
               --+---------------------        10      /
              1 /| o o o o o o o o o o    10   10     96 Sum (z = 5)
              2/ | o . o . o . o . o .     5    9    /
              /                           10   10   67 Sum (z = 6)
      z = 9 |/1 2 3 4 5 6 7 8 9 10         5   10  /
          --+---------------------        10   10 /
         1 /| o o o o o o o o o o    10    5   --/
         2/ | o o o o o o o o o o    10   10   99 Sum (z = 7)
         /                            7    5   /
z = 10 |/1 2 3 4 5 6 7 8 9 10        10   10  /
     --+---------------------        10    5 /
     1 | o o o o o o o o o o    10    7   --/
     2 | o . o . o . o . o .     5   10   75 Sum (z = 8)
     3 | o o o o o o o o o o    10   10   /
     4 | o . o . o . o . o .     5    7  /
     5 | o o o o . o o o o .     8   10 /
     6 | o . o . o . o . o .     5   --/
     7 | o o o o o o o o o o    10   91 Sum (z = 9)
     8 | o . o . o . o . o .     5   /
     9 | o o o o o o o o o o    10  /
    10 | o . o . . . o . o .     4 /
                                --/
                                72 Sum (z = 10)
                                /
                               |
                            ------
                              841 Cube Sum (z = 1..10)
		

References

  • Joachim von zur Gathen and Jürgen Gerhard, Modern Computer Algebra, Cambridge University Press, Second Edition 2003, pp. 53-54.

Crossrefs

Cf. A342586 (for 10^n X 10^n), A018805, A002117 (zeta(3)), A071778.
Related counts of k-tuples:
triples: A071778, A342935, A342841;
quadruples: A082540, A343527, A343193;
5-tuples: A343282;
6-tuples: A343978, A344038. - N. J. A. Sloane, Jun 13 2021

Programs

  • Python
    import math
    for n in range (0, 10):
         counter = 0
         for x in range (1, pow(10, n)+1):
            for y in range(1, pow(10, n)+1):
                for z in range(1, pow(10, n)+1):
                    if math.gcd(math.gcd(y, x),z) ==  1:
                        counter += 1
         print(n, counter)

Formula

Lim_{n->infinity} a(n)/10^(3*n) = 1/zeta(3) = 1/Apéry's constant.
a(n) = A071778(10^n).

Extensions

a(5)-a(10) from Hugo Pfoertner, Mar 25 2021
a(11) from Hugo Pfoertner, Mar 26 2021
a(12) from Bruce Garner, Mar 29 2021
Showing 1-10 of 21 results. Next