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.

Previous Showing 31-40 of 81 results. Next

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

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

Original entry on oeis.org

1, 7, 55, 439, 3433, 27541, 218773, 1749223, 13964245, 111725197, 893433661, 7147232467, 57169672861, 457364647435, 3658819119307, 29270432746633, 234161501271463, 1873293863661469, 14986321908515773, 119890565631185995, 959124025074311215, 7672992332048493361
Offset: 0

Views

Author

Karl-Heinz Hofmann, Mar 29 2021

Keywords

Examples

			For n=3, the size of the division cube matrix is 8 X 8 X 8:
.
                            :   : : : : : : : :
.
                        z = 4 | 1 2 3 4 5 6 7 8
                        ------+----------------------
                          1  /| o o o o o o o o    8
                          2 / | o . o . o . o .    4      64 Sum (z = 1)
                          3/  | o o o o o o o o    8      /
                          /                 o .    4    48  Sum (z = 2)
                  z = 5 |/1 2 3 4 5 6 7 8     o    8    /
                  ------+----------------------    4  60  Sum (z = 3)
                    1  /| o o o o o o o o    8     8  /
                    2 / | o o o o o o o o    8     4 /
                    3/  | o o o o o o o o    8    --/
                    /                 o o    8    48  Sum (z = 4)
            z = 6 |/1 2 3 4 5 6 7 8     o    7    /
            ------+----------------------    8   /
              1  /| o o o o o o o o    8     8  /
              2 / | o . o . o . o .    4     8 /
              3/  | o o o o o o o o    6    --/
              /                 o .    4    63  Sum (z = 5)
      z = 7 |/1 2 3 4 5 6 7 8     o    8    /
      ------+----------------------    3   /
        1  /| o o o o o o o o    8     8  /
        2 / | o o o o o o o o    8     4 /
        3/  | o o o o o o o o    8    --/
        /                 o o    8    45  Sum (z = 6)
z = 8 |/1 2 3 4 5 6 7 8     o    8    /
------+----------------------    8   /
  1   | o o o o o o o o    8     7  /
  2   | o . o . o . o .    4     8 /
  3   | o o o o o o o o    8    --/
  4   | o . o . o . o .    4    63  Sum (z = 7)
  5   | o o o o o o o o    8    /
  6   | o . o . o . o .    4   /
  7   | o o o o o o o o    8  /
  8   | o . o . o . o .    4 /
                          --/
                          48  Sum (z = 8)
                           |
                         ---
                         439  Cube Sum (z = 1..8)
		

Crossrefs

Programs

  • Mathematica
    Array[Sum[MoebiusMu[k]*Floor[(2^#)/k]^3, {k, 2^# + 1}] &, 22, 0] (* Michael De Vlieger, Apr 05 2021 *)
  • Python
    from labmath import mobius
    def A342935(n): return sum(mobius(k)*(2**n//k)**3 for k in range(1, 2**n+1))

Formula

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

Extensions

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

A046657 a(n) = A002088(n)/2.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 11, 14, 16, 21, 23, 29, 32, 36, 40, 48, 51, 60, 64, 70, 75, 86, 90, 100, 106, 115, 121, 135, 139, 154, 162, 172, 180, 192, 198, 216, 225, 237, 245, 265, 271, 292, 302, 314, 325, 348, 356, 377, 387, 403, 415, 441, 450, 470, 482
Offset: 2

Views

Author

Keywords

Comments

a(n) = |{(x,y) : 1 <= x <= y <= n, x + y <= n, 1 = gcd(x,y)}| = |{(x,y) : 1 <= x <= y <= n, x + y > n, 1 = gcd(x,y)}|. - Steve Butler, Mar 31 2006
Brousseau proved that if the starting numbers of a generalized Fibonacci sequence are <= n (for n > 1) then the number of such sequences with relatively prime successive terms is a(n). - Amiram Eldar, Mar 31 2017

Crossrefs

Cf. A002088.
Partial sums of A023022.

Programs

  • GAP
    List([2..60],n->Sum([1..n],k->Phi(k)/2)); # Muniru A Asiru, Mar 05 2018
    
  • Maple
    a:=n->sum(numtheory[phi](k),k=1..n): seq(a(n)/2, n=2..60); # Muniru A Asiru, Mar 05 2018
  • Mathematica
    Rest@ Accumulate[EulerPhi@ Range@ 56]/2 (* Michael De Vlieger, Apr 02 2017 *)
  • PARI
    a(n) = sum(k=1, n, eulerphi(k))/2; \\ Michel Marcus, Apr 01 2017
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A046657(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)*(4*A046657(k1)-1)
            j, k1 = j2, n//j2
        return (n*(n-1)-c+j)//4 # Chai Wah Wu, Mar 25 2021

Formula

a(n) = 1/2 + Sum_{iJoseph Wheat, Feb 22 2018

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

Original entry on oeis.org

0, 1, 2, 5, 6, 13, 14, 21, 26, 37, 38, 53, 54, 69, 82, 97, 98, 121, 122, 145, 162, 185, 186, 217, 226, 253, 270, 301, 302, 345, 346, 377, 402, 437, 458, 505, 506, 545, 574, 621, 622, 681, 682, 729, 770, 817, 818, 881, 894, 953, 990, 1045, 1046, 1117, 1146, 1209
Offset: 1

Views

Author

Douglas Stones (dssto1(AT)student.monash.edu.au), Dec 02 2004

Keywords

Crossrefs

Programs

  • Haskell
    a100613 n = length [()| x <- [1..n], y <- [1..n], gcd x y > 1]
    -- Reinhard Zumkeller, Jan 21 2013
    
  • Mathematica
    f[n_] := Table[ #^2 &[m], {m, 1, n + 1}] - FoldList[Plus, 1, 2 Array[EulerPhi, n, 2]] (* Gregg K. Whisler, Jun 25 2008 *)
  • PARI
    a(n) = sum(i=1, n, sum(j=1, n, gcd(i,j)>1)); \\ Michel Marcus, Jan 30 2017
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A100613(n): # based on second formula in A018805
        if n == 0:
            return 0
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*(k1**2-A100613(k1))
            j, k1 = j2, n//j2
        return n+c-j # Chai Wah Wu, Mar 24 2021

Formula

a(n) = A000290(n) - A018805(n) = A185670(n) + A063985(n). - Reinhard Zumkeller, Jan 21 2013
a(n) = Sum_{k = 2..n} A242114(n,k). - Reinhard Zumkeller, May 04 2014
a(n) ~ kn^2, where k = 1 - 6/Pi^2 = 0.39207... (A229099). - Charles R Greathouse IV, Mar 29 2024

A213212 Number of distinct products i*j*k over all triples (i,j,k) with i,j,k >= 0 and i+j+k <= n and gcd(i,j,k) <= 1.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 6, 10, 12, 17, 20, 26, 29, 38, 44, 52, 59, 72, 78, 94, 104, 118, 130, 149, 160, 182, 198, 221, 237, 263, 278, 308, 330, 361, 383, 416, 438, 480, 509, 546, 574, 620, 646, 699, 734, 777, 816, 872, 907, 969, 1012, 1071, 1117, 1190, 1233, 1307, 1361
Offset: 0

Views

Author

Robert Price, Mar 02 2013

Keywords

Comments

This sequence is in reply to an extension request made in A100450.
Note that gcd(0,m) = m for any m.

Crossrefs

Programs

  • Maple
    h:= proc() true end:
    b:= proc(n) local c, i, j, p;
          c:=0;
          for i to iquo(n, 3) do
            for j from i to iquo(n-i, 2) do
              if igcd(i, j, n-i-j)=1 then p:= i*j*(n-i-j);
                if h(p) then h(p):= false; c:=c+1 fi
              fi
            od
          od; c
        end:
    a:= proc(n) a(n):= `if`(n=0, 1, a(n-1) +b(n)) end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 02 2013
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[ If[ i+j+k <= n&& GCD[i, j, k] <= 1, i*j*k, 0], {i, 0, n}, {j, 0, n}, {k, 0, n}], 2]]]; Table[ f[n], {n, 0, 200}]

Formula

a(n) = (A213208(n) + 1)/2.

A213213 Number of distinct products i*j*k over all triples (i,j,k) with i,j,k>=0 and i+j+k <= n.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 7, 10, 13, 18, 22, 28, 33, 40, 46, 56, 64, 75, 84, 97, 109, 125, 137, 156, 170, 192, 210, 232, 251, 276, 296, 322, 347, 376, 400, 435, 463, 498, 529, 567, 600, 641, 674, 720, 758, 808, 849, 901, 942, 1001, 1051, 1110, 1157, 1225, 1275
Offset: 0

Views

Author

Robert Price, Mar 02 2013

Keywords

Comments

This sequence is in reply to an extension request made in A100450.

Crossrefs

Programs

  • Maple
    h:= proc() true end:
    b:= proc(n) local c, i, j, p;
          c:=0;
          for i to iquo(n, 3) do
            for j from i to iquo(n-i, 2) do p:= i*j*(n-i-j);
              if h(p) then h(p):= false; c:=c+1 fi
            od
          od; c
        end:
    a:= proc(n) a(n):= `if`(n=0, 1, a(n-1) +b(n)) end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 02 2013
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[ If[ i+j+k <= n, i*j*k, 0], {i, 0, n}, {j, 0, n}, {k, 0, n}], 2]]]; Table[ f[n], {n, 0, 200}]

Formula

a(n) = (A213207(n)+1)/2.

A333295 Triangle read by rows: T(m,n) = Sum_{1 <= i <= m, 1 <= j <= n, gcd{i,j}=1} 1, where m >= n >= 1.

Original entry on oeis.org

1, 2, 3, 3, 5, 7, 4, 6, 9, 11, 5, 8, 12, 15, 19, 6, 9, 13, 16, 21, 23, 7, 11, 16, 20, 26, 29, 35, 8, 12, 18, 22, 29, 32, 39, 43, 9, 14, 20, 25, 33, 36, 44, 49, 55, 10, 15, 22, 27, 35, 38, 47, 52, 59, 63, 11, 17, 25, 31, 40, 44, 54, 60, 68, 73, 83, 12, 18, 26, 32, 42, 46, 57, 63, 71, 76, 87, 91
Offset: 1

Views

Author

N. J. A. Sloane, Mar 24 2020

Keywords

Comments

This is the same triangle as A331781, except the initial row and column of 0's is missing.

Examples

			Triangle begins:
1,
2, 3,
3, 5, 7,
4, 6, 9, 11,
5, 8, 12, 15, 19,
6, 9, 13, 16, 21, 23,
7, 11, 16, 20, 26, 29, 35,
8, 12, 18, 22, 29, 32, 39, 43,
9, 14, 20, 25, 33, 36, 44, 49, 55,
10, 15, 22, 27, 35, 38, 47, 52, 59, 63,
11, 17, 25, 31, 40, 44, 54, 60, 68, 73, 83,
12, 18, 26, 32, 42, 46, 57, 63, 71, 76, 87, 91,
...
		

Crossrefs

Cf. A331781. Main diagonal is A018805.

Programs

  • Maple
    V0 := proc(m,n) local a,i,j; a:=0;
    for i from 1 to m do for j from 1 to n do
    if igcd(i,j)=1 then a:=a+1; fi; od: od: a; end;
    for m from 1 to 14 do lprint([seq(V0(m,n),n=1..m)]); od:

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

Original entry on oeis.org

1, 9279, 92434863, 923988964495, 9239427676877311, 92393887177379735327, 923938441006918271400831, 9239384074081430755652624559, 92393840333765561759423951663423, 923938402972369921481535120722882015
Offset: 0

Views

Author

Karl-Heinz Hofmann, Apr 07 2021

Keywords

Examples

			(1,2,2,3) is counted, but (2,4,4,6) is not, because gcd = 2.
For n=1, the size of the division tesseract matrix is 10 X 10 X 10 X 10:
.
              o------------x(w=10)------------o
             /|.                            ./ |
            / |.                           ./  |
           /  |.                          ./   |
          /   |.                         ./    |
         /    |.                      z(w=10)  |
        /     |.                      . /      |
       /      |.                     . /       |
      /       |.                   .  /     y(w=10)
     o------------------------------.o         |
    |\        /|¯¯¯¯¯¯x(w=1)¯¯¯¯¯¯/. |         |
    | w      / |                 /.| |         |
    |  \ z(w=1)|                /. | |         |
    |   \  /   |y(w=1)         /.  | |         |
    |    \/-------------------/.   | |         |
    |     |                   |    | |         |        w | sums
    |     |  Cube at w = 1    |    | |         |      ----+-----
    |     |   10 X 10 X 10    | _ _| |---------o        1 | 1000
    |     |    contains       |    / |         /        2 |  875
    |     |      1000         |   /  |        /         3 |  973
    |     |    completely     |  /   |       /          4 |  875
    |     | reduced fractions | /    |      /           5 |  992
    |     |                   |/     |     /            6 |  849
    |     /------------------- \     |    /             7 |  999
    |    /                      \    |   /              8 |  875
    |   w                        w   |  /               9 |  973
    |  /                          \  | /               10 |  868
    | /                            \ |/               ----+-----
    o -------------------------------o       sum for a(1) | 9279
		

References

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

Crossrefs

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
    from labmath import mobius
    def A343193(n): return sum(mobius(k)*(10**n//k)**4 for k in range(1, 10**n+1))

Formula

Lim_{n->infinity} a(n)/10^(4*n) = 1/zeta(4) = A215267 = 90/Pi^4.
a(n) = A082540(10^n).

Extensions

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

A343527 Number of ordered quadruples (w, x, y, z) with gcd(w, x, y, z) = 1 and 1 <= {w, x, y, z} <= 2^n.

Original entry on oeis.org

1, 15, 239, 3823, 60735, 972191, 15517679, 248252879, 3969108895, 63506982943, 1015951568815, 16255093526239, 260068569617727, 4161109496115135, 66577084386669199, 1065232436999055375, 17043668344393625999, 272698739815301095247, 4363176901343767529551, 69810828455823683068415, 1116973047989955380768527
Offset: 0

Views

Author

Karl-Heinz Hofmann, Apr 18 2021

Keywords

Examples

			.
For n=3, the size of the gris is 8 X 8 X 8 X 8:
.
              o------------x(w=8)-------------o
             /|.                            ./ |
            / |.                           ./  |
           /  |.                          ./   |
          /   |.                         ./    |
         /    |.                      z(w=8)   |
        /     |.                      . /      |
       /      |.                     . /       |
      /       |.                   .  /     y(w=8)
     o------------------------------.o         |
    |\        /|¯¯¯¯¯¯x(w=1)¯¯¯¯¯¯/. |         |
    | w      / |                 /.| |         |
    |  \ z(w=1)|                /. | |         |
    |   \  /   |y(w=1)         /.  | |         |
    |    \/-------------------/.   | |         |
    |     |                   |    | |         |        w | sums
    |     |  Cube at w = 1    |    | |         |      ----+-----
    |     |    8 X 8 X 8      | _ _| |---------o        1 |  512
    |     |    contains       |    / |         /        2 |  448
    |     |       512         |   /  |        /         3 |  504
    |     |    completely     |  /   |       /          4 |  448
    |     | reduced fractions | /    |      /           5 |  511
    |     |                   |/     |     /            6 |  441
    |     /------------------- \     |    /             7 |  511
    |    /                      \    |   /              8 |  448
    |   w                        w   |  /             ----+-----
    |  /                          \  | /     sum for a(3) | 3823
    | /                            \ |/
    o -------------------------------o
		

Crossrefs

Programs

  • Python
    from labmath import mobius
    def A343527(n): return sum(mobius(k)*(2**n//k)**4 for k in range(1, 2**n+1))

Formula

Lim_{n->infinity} a(n)/2^(4*n) = 1/zeta(4) = A215267 = 90/Pi^4.
a(n) = A082540(2^n).

Extensions

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

A344527 Square array T(n,k), n >= 1, k >= 1, read by antidiagonals, where T(n,k) is the number of ordered k-tuples (x_1, x_2, ..., x_k) with gcd(x_1, x_2, ..., x_k) = 1 (1 <= {x_1, x_2, ..., x_k} <= n).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 7, 1, 1, 15, 25, 11, 1, 1, 31, 79, 55, 19, 1, 1, 63, 241, 239, 115, 23, 1, 1, 127, 727, 991, 607, 181, 35, 1, 1, 255, 2185, 4031, 3091, 1199, 307, 43, 1, 1, 511, 6559, 16255, 15559, 7501, 2303, 439, 55, 1, 1, 1023, 19681, 65279, 77995, 45863, 16531, 3823, 637, 63, 1
Offset: 1

Views

Author

Seiichi Manyama, May 22 2021

Keywords

Examples

			G.f. of column 3: (1/(1 - x)) * Sum_{i>=1} mu(i) * (x^i + 4*x^(2*i) + x^(3*i))/(1 - x^i)^3.
Square array begins:
  1,  1,   1,    1,    1,     1, ...
  1,  3,   7,   15,   31,    63, ...
  1,  7,  25,   79,  241,   727, ...
  1, 11,  55,  239,  991,  4031, ...
  1, 19, 115,  607, 3091, 15559, ...
  1, 23, 181, 1199, 7501, 45863, ...
		

Crossrefs

Columns k=1..6 give A000012, A018805, A071778, A082540, A082544, A343978.
T(n,n) gives A332468.

Programs

  • Mathematica
    T[n_, k_] := Sum[MoebiusMu[j] * Quotient[n, j]^k, {j, 1, n}]; Table[T[k, n - k + 1], {n, 1, 11}, {k, 1, n}] // Flatten (* Amiram Eldar, May 22 2021 *)
  • PARI
    T(n, k) = sum(j=1, n, moebius(j)*(n\j)^k);
    
  • PARI
    T(n, k) = n^k-sum(j=2, n, T(n\j, k));
    
  • Python
    from functools import lru_cache
    from itertools import count, islice
    @lru_cache(maxsize=None)
    def A344527_T(n,k):
        if n == 0:
            return 0
        c, j, k1 = 1, 2, n//2
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*A344527_T(k1,k)
            j, k1 = j2, n//j2
        return n*(n**(k-1)-1)-c+j
    def A344527_gen(): # generator of terms
        return (A344527_T(k+1, n-k) for n in count(1) for k in range(n))
    A344527_list = list(islice(A344527_gen(),30)) # Chai Wah Wu, Nov 02 2023

Formula

G.f. of column k: (1/(1 - x)) * Sum_{i>=1} mu(i) * ( Sum_{j=1..k} A008292(k, j) * x^(i*j) )/(1 - x^i)^k.
T(n,k) = Sum_{j=1..n} mu(j) * floor(n/j)^k.
T(n,k) = n^k - Sum_{j=2..n} T(floor(n/j),k).
Previous Showing 31-40 of 81 results. Next