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

A100450 Number of ordered triples (i,j,k) with |i| + |j| + |k| <= n and gcd(i,j,k) <= 1.

Original entry on oeis.org

1, 7, 19, 51, 99, 195, 291, 483, 675, 963, 1251, 1731, 2115, 2787, 3363, 4131, 4899, 6051, 6915, 8355, 9507, 11043, 12483, 14595, 16131, 18531, 20547, 23139, 25443, 28803, 31107, 34947, 38019, 41859, 45315, 49923, 53379, 58851, 63171, 68547
Offset: 0

Views

Author

N. J. A. Sloane, Nov 21 2004

Keywords

Comments

Note that gcd(0,m) = m for any m.
I would also like to get the sequences of the numbers of distinct sums i+j+k (also distinct products i*j*k) over all ordered triples (i,j,k) with |i| + |j| + |k| <= n; also over all ordered triples (i,j,k) with |i| + |j| + |k| <= n and gcd(i,j,k) <= 1.
Also the sequences of the numbers of distinct sums i+j+k (also distinct products i*j*k) over all ordered triples (i,j,k) with i >= 0, j >= 0, k >= 0 and i + j + k = n; also over all ordered triples (i,j,k) with i >= 0, j >= 0, k >= 0, i + j + k = n and gcd(i,j,k) <= 1.
Also the number of ordered triples (i,j,k) with i >= 0, j >= 0, k >= 0, i + j + k = n and gcd(i,j,k) <= 1.
From Robert Price, Mar 05 2013: (Start)
The sequences that address the previous comments are:
Distinct sums i+j+k with or without the GCD qualifier results in a(n)=2n+1 (A005408).
Distinct products i*j*k without the GCD qualifier is given by A213207.
Distinct products i*j*k with the GCD qualifier is given by A213208.
With the restriction i,j,k >= 0 ...
Distinct sums or products equal to n is trivial and always equals one (A000012).
Distinct sums <= n results in a(n)=n (A001477).
Distinct products <= n without the GCD qualifier is given by A213213.
Distinct products <= n with the GCD qualifier is given by A213212.
Ordered triples with sum = n without the GCD qualifier is A000217(n+1).
Ordered triples with sum = n with the GCD qualifier is A048240.
Ordered triples with sum <= n without the GCD qualifier is A000292.
Ordered triples with sum <= n with the GCD qualifier is A048241. (End)
This sequence (A100450) without the GCD qualifier results in A001845. - Robert Price, Jun 04 2013

Crossrefs

Programs

  • Maple
    f:=proc(n) local i,j,k,t1,t2,t3; t1:=0; for i from -n to n do for j from -n to n do t2:=gcd(i,j); for k from -n to n do if abs(i) + abs(j) + abs(k) <= n then t3:=gcd(t2,k); if t3 <= 1 then t1:=t1+1; fi; fi; od: od: od: t1; end;
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[ If[ Abs[i] + Abs[j] + Abs[k] <= n && GCD[i, j, k] <= 1, {i, j, k}, {0, 0, 0}], {i, -n, n}, {j, -n, n}, {k, -n, n}], 2]]]; Table[ f[n], {n, 0, 40}] (* Robert G. Wilson v, Dec 14 2004 *)

Formula

G.f.: (3 + Sum_{k>=1} (moebius(k)*((1+x^k)/(1-x^k))^3))/(1-x). - Vladeta Jovovic, Nov 22 2004. [Sketch of proof: Let b(n) = number of ordered triples (i, j, k) with |i| + |j| + |k| = n and gcd(i, j, k) <= 1. Then a(n) = A100450(n) = partial sums of b(n) and Sum_{d divides n} b(d) = 4*n^2+2 = A005899(n) with g.f. ((1+x)/(1-x))^3.]

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

A027425 Number of distinct products ijk with 1 <= i,j,k <= n.

Original entry on oeis.org

1, 4, 10, 16, 30, 40, 65, 80, 100, 120, 173, 194, 266, 301, 343, 378, 492, 536, 678, 732, 804, 876, 1075, 1130, 1247, 1343, 1450, 1537, 1833, 1909, 2248, 2362, 2515, 2668, 2850, 2940, 3400, 3587, 3789, 3919, 4477, 4624, 5242, 5440, 5654, 5916
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (nub)
    a027425 n = length $ nub [i*j*k | i <- [1..n], j <- [1..n], k <- [1..n]]
    -- Reinhard Zumkeller, Jan 01 2012
    
  • Maple
    f:=proc(n) local i,j,k,t1,t2; t1:={}; for i from 1 to n do for j from i to n do for k from j to n do t1:={op(t1),i*j*k}; od: od: od: t1:=convert(t1,list); nops(t1); end;
  • Mathematica
    a[n_] := Reap[Do[Sow[i*j*k], {i, 1, n}, {j, i, n}, {k, j, n}]][[2, 1]] // Union // Length; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Jan 30 2018 *)
  • PARI
    pr(n)=my(v=List());for(i=1,n, for(j=i,n, listput(v, i*j))); Set(v)
    a(n)=my(v=pr(n),u=v); for(i=2,n,u=Set(concat(u,v*i))); #u \\ Charles R Greathouse IV, Mar 04 2014
    
  • Python
    def A027425(n): return len({i*j*k for i in range(1,n+1) for j in range(1,i+1) for k in range(1,j+1)}) # Chai Wah Wu, Oct 16 2023

Formula

a(n) = A027426(n)-1. - T. D. Noe, Jan 16 2007

A100449 Number of ordered pairs (i,j) with |i| + |j| <= n and gcd(i,j) <= 1.

Original entry on oeis.org

1, 5, 9, 17, 25, 41, 49, 73, 89, 113, 129, 169, 185, 233, 257, 289, 321, 385, 409, 481, 513, 561, 601, 689, 721, 801, 849, 921, 969, 1081, 1113, 1233, 1297, 1377, 1441, 1537, 1585, 1729, 1801, 1897, 1961, 2121, 2169, 2337, 2417, 2513, 2601, 2785, 2849, 3017
Offset: 0

Views

Author

N. J. A. Sloane, Nov 21 2004

Keywords

Comments

Note that gcd(0,m) = m for any m.
I would also like to get the sequences of the numbers of distinct sums i+j (also distinct products i*j) over all ordered pairs (i,j) with |i| + |j| <= n; also over all ordered pairs (i,j) with |i| + |j| <= n and gcd(i,j) <= 1.
From Robert Price, May 10 2013: (Start)
List of sequences that address these extensions:
Distinct sums i+j with or without the GCD qualifier results in a(n)=2n+1 (A005408).
Distinct products i*j without the GCD qualifier is given by A225523.
Distinct products i*j with the GCD qualifier is given by A225526.
With the restriction i,j >= 0 ...
Distinct sums or products equal to n is trivial and always equals one (A000012).
Distinct sums <=n with or without the GCD qualifier results in a(n)=n (A001477).
Distinct products <=n without the GCD qualifier is given by A225527.
Distinct products <=n with the GCD qualifier is given by A225529.
Ordered pairs with the sum = n without the GCD qualifier is a(n)=n+1.
Ordered pairs with the sum = n with the GCD qualifier is A225530.
Ordered pairs with the sum <=n without the GCD qualifier is A000217(n+1).
Ordered pairs with the sum <=n with the GCD qualifier is A225531.
(End)
This sequence (A100449) without the GCD qualifier results in A001844. - Robert Price, Jun 04 2013

Crossrefs

Programs

  • Maple
    f:=proc(n) local i,j,k,t1,t2,t3; t1:=0; for i from -n to n do for j from -n to n do if abs(i) + abs(j) <= n then t2:=gcd(i,j); if t2 <= 1 then t1:=t1+1; fi; fi; od: od: t1; end;
    # second Maple program:
    b:= proc(n) b(n):= numtheory[phi](n)+`if`(n=0, 0, b(n-1)) end:
    a:= n-> 1+4*b(n):
    seq(a(n), n=0..50);  # Alois P. Heinz, Mar 01 2013
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[ If[ Abs[i] + Abs[j] <= n && GCD[i, j] <= 1, {i, j}, {0, 0}], {i, -n, n}, {j, -n, n}], 1]]]; Table[ f[n], {n, 0, 49}] (* Robert G. Wilson v, Dec 14 2004 *)
  • PARI
    a(n) = 1+4*sum(k=1, n, eulerphi(k) ); \\ Joerg Arndt, May 10 2013
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A100449(n):
        if n == 0:
            return 1
        c, j = 0, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c += (j2-j)*((A100449(k1)-3)//2)
            j, k1 = j2, n//j2
        return 2*(n*(n-1)-c+j)+1 # Chai Wah Wu, Mar 29 2021

Formula

a(n) = 1 + 4*Sum(phi(k), k=1..n) = 1 + 4*A002088(n). - Vladeta Jovovic, Nov 25 2004

Extensions

More terms from Vladeta Jovovic, Nov 25 2004

A213207 Number of distinct products i*j*k over all triples (i,j,k) with |i| + |j| + |k| <= n.

Original entry on oeis.org

1, 1, 1, 3, 5, 9, 13, 19, 25, 35, 43, 55, 65, 79, 91, 111, 127, 149, 167, 193, 217, 249, 273, 311, 339, 383, 419, 463, 501, 551, 591, 643, 693, 751, 799, 869, 925, 995, 1057, 1133, 1199, 1281, 1347, 1439, 1515, 1615, 1697, 1801, 1883, 2001, 2101, 2219, 2313
Offset: 0

Views

Author

Robert Price, Mar 01 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) +2*b(n)) end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 02 2013
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[ If[ Abs[i] + Abs[j] + Abs[k] <= n, {i*j*k}, {0}], {i, -n, n}, {j, -n, n}, {k, -n, n}], 2]]]; Table[ f[n], {n, 0, 100}]

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

Original entry on oeis.org

1, 1, 1, 3, 5, 9, 11, 19, 23, 33, 39, 51, 57, 75, 87, 103, 117, 143, 155, 187, 207, 235, 259, 297, 319, 363, 395, 441, 473, 525, 555, 615, 659, 721, 765, 831, 875, 959, 1017, 1091, 1147, 1239, 1291, 1397, 1467, 1553, 1631, 1743, 1813, 1937, 2023, 2141, 2233, 2379, 2465
Offset: 0

Views

Author

Robert Price, Mar 01 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) +2*b(n)) end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 01 2013
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[ If[ Abs[i] + Abs[j] + Abs[k] <= n&& GCD[i, j, k] <= 1, i*j*k, 0], {i, -n, n}, {j, -n, n}, {k, -n, n}], 2]]]; Table[ f[n], {n, 0, 100}]

A100440 Number of distinct values of i*j + j*k + k*i with 1 <= i <= j <= k <= n.

Original entry on oeis.org

1, 4, 10, 20, 33, 50, 68, 93, 123, 154, 193, 233, 276, 325, 377, 434, 500, 568, 643, 720, 804, 885, 979, 1068, 1168, 1274, 1381, 1495, 1615, 1746, 1876, 2005, 2148, 2285, 2437, 2596, 2748, 2908, 3077, 3241, 3425, 3608, 3796, 3979, 4181, 4388, 4585, 4804, 5015, 5237
Offset: 1

Views

Author

N. J. A. Sloane, Nov 21 2004

Keywords

Comments

a(n) <= A000292(n); a(n) = number of terms in n-th row of the triangle in A200741. - Reinhard Zumkeller, Nov 21 2011

Crossrefs

Programs

  • Haskell
    a100440 = length . a200741_row  -- Reinhard Zumkeller, Nov 21 2011
    
  • Maple
    f:=proc(n) local i,j,k,t1; t1:={}; for i from 1 to n do for j from i to n do for k from j to n do t1:={op(t1),i*j+j*k+k*i}; od: od: od: t1:=convert(t1,list); nops(t1); end;
  • Mathematica
    f[n_] := Length[ Union[ Flatten[ Table[i*j + j*k + k*i, {i, n}, {j, i, n}, {k, j, n}] ]]]; Table[ f[n], {n, 48}] (* Robert G. Wilson v, Dec 14 2004 *)
  • PARI
    first(n) = {my(v = vector(3*n^2, i, oo), res = vector(n)); forvec(x = vector(3, i, [1,n]), c = x[1]*x[2] + x[1]*x[3] + x[2]*x[3]; v[c] = min(x[3],v[c]); , 1); for(i = 1, #v, if(v[i] < oo, res[v[i]]++)); for(i = 2, #res, res[i] += res[i-1]); res } \\ David A. Corneth, Mar 23 2021
    
  • Python
    from numba import njit
    @njit()
    def aupton(terms):
      aset, alst = set(), []
      for n in range(1, terms+1):
        for i in range(1, n+1):
          for j in range(i, n+1):
            aset.add(i*j + j*n + n*i)
        alst.append(len(aset))
      return alst
    print(aupton(50)) # Michael S. Branicky, Mar 23 2021

Extensions

More terms from Robert G. Wilson v, Dec 14 2004

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.

A027428 Number of distinct products ij with 1 <= i < j <= n. (Number of terms appearing more than once in a 1-to-n multiplication table.)

Original entry on oeis.org

0, 1, 3, 6, 10, 13, 19, 24, 31, 36, 46, 51, 63, 70, 78, 87, 103, 111, 129, 139, 150, 161, 183, 192, 210, 223, 239, 252, 280, 291, 321, 337, 354, 371, 390, 403, 439, 458, 478, 493, 533, 549, 591, 611, 631, 654, 700, 717, 752, 774, 800, 823, 875
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (nub)
    a027428 n = length $ nub [i*j | j <- [2..n], i <- [1..j-1]]
    -- Reinhard Zumkeller, Jan 01 2012
    
  • Maple
    f:=proc(n) local i,j,t1,t2; t1:={}; for i from 1 to n-1 do for j from i+1 to n do t1:={op(t1),i*j}; od: od: t1:=convert(t1,list); nops(t1); end;
  • Mathematica
    a[n_] := Table[i*j, {i, 1, n-1}, {j, i+1, n}] // Flatten // Union // Length; Table[ a[n] , {n, 1, 53}] (* Jean-François Alcover, Jan 31 2013 *)
  • Python
    def A027428(n): return len({i*j for i in range(1,n+1) for j in range(1,i)}) # Chai Wah Wu, Oct 13 2023

Formula

a(n) = A027427(n) - 1. - T. D. Noe, Jan 16 2007
Showing 1-10 of 26 results. Next