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-6 of 6 results.

A306673 a(n) is the number of distinct, non-similar acute triangles with integer sides and largest side <= n.

Original entry on oeis.org

1, 2, 4, 7, 12, 16, 26, 34, 46, 56, 76, 90, 116, 135, 161, 187, 229, 257, 308, 344, 394, 439, 511, 558, 636, 698, 779, 849, 959, 1027, 1152, 1245, 1362, 1465, 1603, 1703, 1874, 2004, 2164, 2298, 2507, 2639, 2867, 3034, 3235, 3421, 3690, 3866, 4147, 4354
Offset: 1

Views

Author

César Eliud Lozada, Mar 04 2019

Keywords

Examples

			For n=4, there are 9 acute triangles with integer sides and largest side <= 4. These have sides {a,b,c} = {1, 1, 1}, {1, 2, 2}, {1, 3, 3}, {1, 4, 4}, {2, 2, 2}, {2, 2, 4}, {2, 3, 3}, {3, 3, 4}, {3, 4, 4}. But {2, 2, 2} is similar to {1,1,1} and {2,2,4} is similar to {1,1,2}, so these two triangles are excluded from the list and therefore a(4)=7.
		

Crossrefs

Programs

  • Maple
    #nType=1 for acute triangles, nType=2 for obtuse triangles, nType=0 for both triangles
    CountTriangles := proc (n, nType := 1)
      local aa, oo, a, b, c, tt, lAcute;
      aa := {}; oo := {};
      for a from n by -1 to 1 do for b from a by -1 to 1 do for c from b by -1 to 1 do
        if a < b+c and abs(b-c) < a and b < c+a and abs(c-a) < b and c < a+b and abs(a-b) < c and gcd(a, gcd(b, c)) = 1 then
          lAcute := evalb(0 < b^2+c^2-a^2);
          tt := sort([a, b, c]);
          if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if
        end if
      end do end do end do;
      return sort(`if`(nType = 1, aa, `if`(nType=2,oo,`union`(aa,oo))))
    end proc
  • Mathematica
    Length@Select[DeleteDuplicates[Sort@# & /@ Tuples[Range@#, 3]], GCD @@ # == 1 && #[[1]] + #[[2]] > #[[3]] && #[[1]]^2 + #[[2]]^2 > #[[3]]^2 &] & /@ Range@50 (* Hans Rudolf Widmer, Dec 07 2023 *)

A306674 Number of distinct non-similar obtuse triangles with integer sides and length of largest side <= n.

Original entry on oeis.org

0, 0, 1, 2, 5, 9, 14, 21, 31, 44, 59, 76, 98, 123, 153, 186, 224, 266, 314, 368, 426, 491, 562, 638, 723, 815, 915, 1021, 1135, 1258, 1388, 1528, 1677, 1836, 2006, 2183, 2372, 2569, 2780, 3002, 3233, 3476, 3731, 4000, 4282, 4574, 4880, 5198, 5531, 5879
Offset: 1

Views

Author

César Eliud Lozada, Mar 04 2019

Keywords

Examples

			For n=6, there are 9 integer-sided obtuse triangles with largest side <= n. These have sides {a, b, c} = {2, 2, 3}, {2, 3, 4}, {2, 4, 5}, {2, 5, 6}, {3, 3, 5}, {3, 4, 5}, {3, 4, 6}, {3, 5, 6}, {4, 4, 6}. But {4, 4, 6} is similar to {2, 2, 3} and is excluded from the list, so a(6) = 8.
		

Crossrefs

Programs

  • Maple
    #nType=1 for acute triangles, nType=2 for obtuse triangles, nType=0 for both triangles
    CountTriangles := proc (n, nType := 1)
      local aa, oo, a, b, c, tt, lAcute;
      aa := {}; oo := {};
      for a from n by -1 to 1 do for b from a by -1 to 1 do for c from b by -1 to 1 do
        if a < b+c and abs(b-c) < a and b < c+a and abs(c-a) < b and c < a+b and abs(a-b) < c and gcd(a, gcd(b, c)) = 1 then
          lAcute := evalb(0 < b^2+c^2-a^2);
          tt := sort([a, b, c]);
          if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if
        end if
      end do end do end do;
      return sort(`if`(nType = 1, aa, `if`(nType=2,oo,`union`(aa,oo))))
    end proc

A306676 Number of distinct acute triangles with prime sides and largest side = prime(n).

Original entry on oeis.org

1, 2, 3, 5, 5, 8, 9, 11, 13, 12, 18, 17, 21, 27, 30, 28, 30, 38, 38, 43, 56, 53, 59, 59, 56, 64, 79, 85, 100, 106, 79, 90, 96, 115, 102, 123, 124, 130, 144, 147, 152, 177, 161, 188, 199, 225, 193, 175, 195, 228, 248, 247, 280, 259, 267, 277, 288, 324
Offset: 1

Views

Author

César Eliud Lozada, Mar 04 2019

Keywords

Examples

			For n=3, prime(n)=5. Acute triangles: {2,5,5}, {3,5,5}, {5,5,5} (Total=3=a(3)).
For n=4, prime(n)=7. Acute triangles: {2,7,7}, {3,7,7}, {5,5,7}, {5, 7, 7}, {7, 7, 7} (Total=5=a(4)).
		

Crossrefs

Programs

  • Maple
    #nType=1 for acute triangles, nType=2 for obtuse triangles
    #nType=0 for both triangles
    CountPrimeTriangles := proc (n, nType := 1)
      local aa, oo, j, k, sg, a, b, c, tt, lAcute;
      aa := {}; oo := {};
      a := ithprime(n);
      for j from n by -1 to 1 do
        b := ithprime(j);
        for k from j by -1 to 1 do
          c := ithprime(k);
          if a < b+c and abs(b-c) < a and b < c+a and abs(c-a) < b and c < a+b and abs(a-b) < c then
            lAcute := evalb(0 < b^2+c^2-a^2);
            tt := sort([a, b, c]);
            if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if
          end if
        end do
      end do;
      return sort(`if`(nType = 1, aa, `if`(nType = 2, oo, `union`(aa, oo))))
    end proc:

A306677 Number of distinct obtuse triangles with prime sides and largest side = prime(n).

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 4, 7, 8, 10, 11, 13, 16, 19, 23, 28, 30, 33, 37, 44, 45, 52, 59, 65, 67, 75, 78, 88, 93, 103, 107, 117, 123, 129, 139, 141, 153, 161, 174, 182, 192, 194, 212, 217, 234, 240, 254, 265, 279, 283, 297, 316, 317, 343, 356, 368, 380, 382, 404
Offset: 1

Views

Author

César Eliud Lozada, Mar 04 2019

Keywords

Examples

			For n=5, prime(n)=11. Triangles: {5, 7, 11}, {7, 7, 11}, so a(5) = 2.
For n=6, prime(n)=13. Triangles: {3, 11, 13}, {5, 11, 13}, {7, 7, 13}, so a(6)=3.
		

Crossrefs

Programs

  • Maple
    #nType=1 for acute triangles, nType=2 for obtuse triangles
    #nType=0 for both triangles
    CountPrimeTriangles := proc (n, nType := 1)
      local aa, oo, j, k, sg, a, b, c, tt, lAcute;
      aa := {}; oo := {};
      a := ithprime(n);
      for j from n by -1 to 1 do
        b := ithprime(j);
        for k from j by -1 to 1 do
          c := ithprime(k);
          if a < b+c and abs(b-c) < a and b < c+a and abs(c-a) < b and c < a+b and abs(a-b) < c then
            lAcute := evalb(0 < b^2+c^2-a^2);
            tt := sort([a, b, c]);
            if lAcute then aa := {op(aa), tt} else oo := {op(oo), tt} end if
          end if
        end do
      end do;
      return sort(`if`(nType = 1, aa, `if`(nType = 2, oo, `union`(aa, oo))))
    end proc:

A378819 a(n) is the number of distinct nondegenerate triangles whose sides are prime factors of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 4, 1, 1, 1, 3, 1, 4, 1, 3, 4, 1, 1, 4, 1, 3, 3, 3, 1, 4, 1, 3, 1, 3, 1, 8, 1, 1, 3, 3, 4, 4, 1, 3, 3, 3, 1, 7, 1, 3, 4, 3, 1, 4, 1, 3, 3, 3, 1, 4, 3, 3, 3, 3, 1, 8, 1, 3, 3, 1, 3, 7, 1, 3, 3, 7, 1, 4, 1, 3, 4, 3, 4, 7, 1, 3, 1, 3, 1, 7, 3, 3, 3, 3
Offset: 1

Views

Author

Felix Huber, Dec 27 2024

Keywords

Comments

A prime factor can be used for several sides.
A nondegenerate triangle is a triangle whose sides (u, v, w) are such that u + v > w, v + w > u and u + w > v.

Examples

			a(10) = 3 because there are the 3 distinct nondegenerate triangles (2, 2, 2), (2, 5, 5), (5, 5, 5) whose sides are prime factors of 10. Since 2 + 2 < 5, (2, 2, 5) is not a triangle.
		

Crossrefs

Programs

  • Maple
    A378819:=proc(n)
       local a,i,j,k,L;
       L:=NumberTheory:-PrimeFactors(n);
       a:=0;
       for i to nops(L) do
          for j from i to nops(L) do
             for k from j to nops(L) while L[k]A378819(n),n=1..88);

Formula

a(n) = a(A007947(n)).
a(p^k) = 1 for prime powers p^k (p prime, k >= 1).

A379033 Numbers that are the product of exactly three (not necessarily distinct) primes and these primes are sides of a nondegenerate triangle.

Original entry on oeis.org

8, 12, 18, 27, 45, 50, 75, 98, 105, 125, 147, 175, 242, 245, 338, 343, 363, 385, 429, 507, 539, 578, 605, 637, 715, 722, 845, 847, 867, 969, 1001, 1058, 1083, 1105, 1183, 1309, 1331, 1445, 1547, 1573, 1587, 1615, 1682, 1729, 1805, 1859, 1922, 2023, 2057, 2185, 2197
Offset: 1

Views

Author

Felix Huber, Dec 24 2024

Keywords

Comments

Subsequence of A014612 and of A145784.
Numbers that are the product of exactly three (not necessarily distinct) primes and these primes are sides of a degenerate triangle are in A071142.

Examples

			12 = 2*2*3 is in the sequence because 2 + 2 > 3.
20 = 2*2*5 is not in the sequence because 2 + 2 < 5.
30 = 2*3*5 is not in the sequence because 2 + 3 = 5.
		

Crossrefs

Programs

  • Maple
    A379033:=proc(n)
       option remember;
       local a,i,j,P;
       if n=1 then
          8
       else
          for a from procname(n-1)+1 do
             P:=[];
             if NumberTheory:-Omega(a)=3 then
                for i in ifactors(a)[2] do
                   j:=0;
                   while jP[3] then
                   return a
                fi
             fi
          od
       fi	
    end proc;
    seq(A379033(n),n=1..51);
Showing 1-6 of 6 results.