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

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

Original entry on oeis.org

1, 3, 4, 6, 7, 11, 13, 18, 21, 22, 29, 30, 37, 46, 53, 56, 60, 71, 75, 87, 101, 105, 118, 124, 123, 139, 157, 173, 193, 209, 186, 207, 219, 244, 241, 264, 277, 291, 318, 329, 344, 371, 373, 405, 433, 465, 447, 440, 474, 511, 545, 563, 597, 602, 623, 645
Offset: 1

Views

Author

César Eliud Lozada, Mar 04 2019

Keywords

Examples

			For n=1, there is 1 triangle: {2, 2, 2}, with largest side prime(1) = 2.
For n=2, there are 3 triangles: {2, 2, 3}, {2, 3, 3}, {3, 3, 3}, with largest side prime(2) = 3.
For n=4, there are 6 triangles :{2, 7, 7}, {3, 5, 7}, {3, 7, 7}, {5, 5, 7}, {5, 7, 7}, {7, 7, 7}, with largest side prime(4) = 7. Total = 6 = a(4).
For n=5, largest side = prime(n) = 11. Triangles are {{2, 11, 11}, {3, 11, 11}, {5, 7, 11}, {5, 11, 11}, {7, 7, 11}, {7, 11, 11}, {11, 11, 11}}. Total = 7 = a(5).
		

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:
    # Alternative:
    with(NumberTheory):
    A306678:=proc(n)
        local a,i,p;
        if n=1 then
            1
        else
            a:=0;
            p:=ithprime(n);
            for i from pi(nextprime((p-1)/2)) to n do
                a:=a+i-pi(nextprime(p-ithprime(i)))+1;
            od;
                return a
    	fi;		
    end proc;
    seq(A306678(n),n=1..56); # Felix Huber, Apr 19 2025

Formula

a(n) = A306676(n) + A306677(n).

A378820 a(n) is the number of distinct nondegenerate triangles whose sides are divisors of n.

Original entry on oeis.org

1, 3, 3, 6, 3, 11, 3, 10, 6, 10, 3, 26, 3, 10, 11, 15, 3, 23, 3, 23, 10, 10, 3, 46, 6, 10, 10, 22, 3, 45, 3, 21, 10, 10, 11, 57, 3, 10, 10, 43, 3, 41, 3, 21, 24, 10, 3, 70, 6, 21, 10, 21, 3, 39, 10, 42, 10, 10, 3, 114, 3, 10, 23, 28, 10, 39, 3, 21, 10, 42, 3, 108
Offset: 1

Views

Author

Felix Huber, Dec 27 2024

Keywords

Comments

A divisor 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(4) = 6 because there are the 6 distinct nondegenerate triangles (1, 1, 1), (1, 2, 2), (1, 4, 4), (2, 2, 2), (2, 4, 4), (4, 4, 4) whose sides are divisors of 4. The triples (1, 1, 2), (1, 1, 4), (1, 2, 4), (2, 2, 4) are not sides of (nondegenerate) triangles.
		

Crossrefs

Programs

  • Maple
    A378820:=proc(n)
       local a,i,j,k,L;
       L:=NumberTheory:-Divisors(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]A378820(n),n=1..72);

Formula

a(p) = 3 for prime p.

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