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

A188158 Area A of the triangles such that A and the sides are integers.

Original entry on oeis.org

6, 12, 24, 30, 36, 42, 48, 54, 60, 66, 72, 84, 90, 96, 108, 114, 120, 126, 132, 144, 150, 156, 168, 180, 192, 198, 204, 210, 216, 234, 240, 252, 264, 270, 288, 294, 300, 306, 324, 330, 336, 360, 378, 384, 390, 396, 408, 420, 432, 456, 462, 468, 480, 486, 504, 510, 522, 528
Offset: 1

Views

Author

Michel Lagneau, Mar 22 2011

Keywords

Comments

The area A of a triangle whose sides have lengths a, b, and c is given by Heron's formula: A = sqrt(s*(s-a)*(s-b)*(s-c)), where s = (a+b+c)/2. A given area often corresponds to more than one triangle; for example, a(9) = 60 for the triangles (a,b,c) = (6,25,29), (8,17,15), (13,13,10) and (13,13,24).
If only primitive integer triangles (that is, the lengths of the sides are coprime) are considered, then the possible areas are 6 times the terms in A083875. - T. D. Noe, Mar 23 2011

Examples

			a(3) = 24 because the area of the triangle whose sides are 4, 15, 13 is given by sqrt(p(p-4)(p-15)(p-13)) = 24, where p = (4 + 15 + 13)/2 = 16.
		

Crossrefs

Programs

  • Maple
    # storage of areas in T(i)
    T:=array(1..4000):nn:=100:k:=1:for a from 1
      to nn do: for b from 1 to nn do: for c from 1 to nn do: p:=(a+b+c)/2 : x:=p*(p-a)*(p-b)*(p-c):   if x>0 then x1:=abs(x):s:=sqrt(x1) :else fi:if s=floor(s) then T[k]:=s:k:=k+1:else
      fi:od:od:od:
    # sort of T(i)
    for jj from 1 to k-1 do: ii:=jj:for k1 from  ii+1 to k-1 do:if T[ii]>T[k1] then ii:=k1:else fi:od: m:=T[jj]:T[jj]:=T[ii]:T[ii]:=m:od:liste:=convert(T,set):print(liste):
    # second program:
    isA188158 := proc(A::integer)
        local Asqr, s,a,b,c ;
        Asqr := A^2 ;
        for s in numtheory[divisors](Asqr) do
            if s^2> A then
            for a from 1 to s-1 do
                if modp(Asqr,s-a) = 0 then
                    for b from a to s-1 do
                        c := 2*s-a-b ;
                        if s*(s-a)*(s-b)*(s-c) = Asqr then
                            return true ;
                        end if;
                    end do:
                end if;
            end do:
            end if;
        end do:
        false ;
    end proc:
    for n from 3 to 600 do
        if isA188158(n) then
            printf("%d,\n",n) ;
        end if;
    end do: # R. J. Mathar, May 02 2018
  • Mathematica
    nn = 528; lst = {}; Do[s = (a + b + c)/2; If[IntegerQ[s], area2 = s (s - a) (s - b) (s - c); If[0 < area2 <= nn^2 && IntegerQ[Sqrt[area2]], AppendTo[lst, Sqrt[area2]]]], {a, nn}, {b, a}, {c, b}]; Union[lst] (* T. D. Noe, Mar 23 2011 *)

A051518 Perimeters of Heronian triangles.

Original entry on oeis.org

12, 16, 18, 24, 30, 32, 36, 40, 42, 44, 48, 50, 54, 56, 60, 64, 66, 68, 70, 72, 76, 78, 80, 84, 88, 90, 96, 98, 100, 104, 108, 110, 112, 114, 120, 126, 128, 130, 132, 136, 140, 144, 150, 152, 154, 156, 160, 162, 164, 168, 170, 172, 174, 176, 180, 182, 186, 190, 192, 196, 198, 200, 204
Offset: 1

Views

Author

Keywords

Comments

A triangle with integer sides and area is also called a Heronian triangle, and every such triangle can be positioned in the plane so that its three vertices have integer coordinates. - Peter Kagey, Jan 24 2018

Crossrefs

Positions of nonzero values in A051516.

Extensions

Name changed by Wesley Ivan Hurt, May 16 2020

A070138 Number of integer triangles with an integer area having relatively prime sides a, b and c such that a + b + c = n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 5, 0, 0, 0, 0, 0, 3
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2002

Keywords

Comments

From Peter Kagey, Jan 30 2018: (Start)
a(k) > 0 if and only if k is in A096468.
Records appear at indices 12, 36, 54, 84, 98, 162, 242, 338, 484, 578, ....
a(2k - 1) = 0 for all integers k > 0.
(End)

Crossrefs

Extensions

Corrected by T. D. Noe, Jun 17 2004

A070086 Areas of integer triangles [A070080(n), A070081(n), A070082(n)], rounded values.

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 2, 3, 4, 4, 4, 2, 4, 4, 6, 5, 6, 7, 3, 5, 5, 7, 8, 6, 7, 8, 9, 3, 6, 6, 9, 7, 10, 11, 7, 9, 10, 11, 12, 4, 6, 8, 10, 8, 12, 12, 14, 8, 10, 12, 13, 12, 15, 16, 4, 7, 9, 12, 10, 14, 10, 15, 16, 17, 9, 12, 13, 15, 14, 17, 18, 19, 5, 8, 10
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2002

Keywords

Comments

Triangles [A070080(A070142(n)), A070081(A070142(n)), A070082(A070142(n))] have integer areas = a(A070142(k)) = A070149(k).

Examples

			[A070080(25), A070081(25), A070082(25)] = [3,5,6] and s = A070083(25)/2 = (3+5+6)/2 = 7: a(25) = sqrt(s*(s-3)*(s-5)*(s-6)) = sqrt(7*(7-3)*(7-5)*(7-6)) = sqrt(7*4*2*1) = sqrt(56) = 7.48331, rounded = 7.
		

Crossrefs

The sides are given by A070080, A070081, A070082.
See A135622 for values signifying the precise area and further crossrefs.

Programs

  • Mathematica
    m = 50; (* max perimeter *)
    sides[per_] := Select[Reverse /@ IntegerPartitions[per, {3}, Range[ Ceiling[per/2]]], #[[1]] < per/2 && #[[2]] < per/2 && #[[3]] < per/2 &];
    triangles = DeleteCases[Table[sides[per], {per, 3, m}], {}] // Flatten[#, 1]& // SortBy[Total[#] m^3 + #[[1]] m^2 + #[[2]] m + #[[1]]&];
    area[{a_, b_, c_}] := With[{p = (a+b+c)/2}, Sqrt[p(p-a)(p-b)(p-c)] // Round];
    area /@ triangles (* Jean-François Alcover, Oct 03 2021 *)

Formula

a(n) = sqrt(s*(s-u)*(s-v)*(s-w)), where u=A070080(n), v=A070081(n), w=A070082(n) and s = A070083(n)/2 = (u+v+w)/2.

A070109 Number of right integer triangles with perimeter n and relatively prime side lengths.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2002

Keywords

Comments

Right integer triangles have integer areas: see A070142, A051516.
a(n) is nonzero iff n is in A024364.

Examples

			For n=30 there are A005044(30) = 19 integer triangles; only one is right: 5+12+13 = 30, 5^2+12^2 = 13^2; therefore a(30) = 1.
		

Crossrefs

Programs

  • Mathematica
    unitaryDivisors[n_] := Cases[Divisors[n], d_ /; GCD[d, n/d] == 1];
    A078926[n_] := Count[unitaryDivisors[n], d_ /; OddQ[d] && Sqrt[n] < d < Sqrt[2n]];
    a[n_] := If[EvenQ[n], A078926[n/2], 0];
    Table[a[n], {n, 1, 1716}] (* Jean-François Alcover, Oct 04 2021 *)

Formula

a(n) = A078926(n/2) if n is even; a(n)=0 if n is odd.
a(n) = A051493(n) - A070094(n) - A070102(n).
a(n) <= A024155(n).

Extensions

Secondary offset added by Antti Karttunen, Oct 07 2017

A070142 Numbers n such that [A070080(n), A070081(n), A070082(n)] is an integer triangle with integer area.

Original entry on oeis.org

17, 39, 52, 116, 212, 252, 269, 368, 370, 372, 375, 493, 561, 587, 659, 839, 850, 862, 957, 972, 1156, 1186, 1196, 1204, 1297, 1582, 1599, 1629, 1912, 1920, 1955, 1971, 1988, 2115, 2352, 2555, 2574, 2713, 2774, 2778, 2790
Offset: 1

Views

Author

Reinhard Zumkeller, May 05 2002

Keywords

Examples

			a(2)=39: [A070080(39), A070081(39), A070082(39)] = [5,5,6], area^2 = s*(s-5)*(s-5)*(s-6) with s=A070083(39)/2=(5+5+6)/2=8, area^2=8*3*3*2=16*9 is an integer square, therefore A070086(39)=area=4*3=12.
		

Crossrefs

Programs

  • Mathematica
    maxPerim = 100; maxSide = Floor[(maxPerim - 1)/2]; order[{a_, b_, c_}] := (a + b + c)*maxPerim^3 + a*maxPerim^2 + b*maxPerim + c; triangles = Reap[ Do[ If[ a + b + c <= maxPerim && c - b < a < c + b && b - a < c < b + a && c - a < b < c + a, Sow[{a, b, c}]], {a, 1, maxSide}, {b, a, maxSide}, {c, b, maxSide}]][[2, 1]]; stri = Sort[ triangles, order[#1] < order[#2]&]; area[{a_, b_, c_}] := With[{p = (a + b + c)/2}, Sqrt[p*(p - a)*(p - b)*(p - c)]]; Position[ stri, tri_ /; IntegerQ[area[tri]]] // Flatten (* Jean-François Alcover, Feb 22 2013 *)

A305717 Number of distinct Heronian triangles with perimeter A051518(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 4, 1, 2, 1, 3, 2, 4, 1, 3, 5, 1, 1, 2, 5, 1, 1, 4, 8, 1, 5, 5, 6, 5, 2, 12, 1, 6, 1, 5, 4, 9, 1, 9, 2, 5, 11, 8, 2, 3, 5, 7, 12, 1, 10, 1, 1, 1, 7, 10, 3, 2, 2, 15, 14, 5, 10, 5, 5, 11, 16, 5, 1, 12, 7, 3, 1, 7, 1, 2, 15, 16, 1, 11, 16, 18
Offset: 1

Views

Author

Peter Kagey, Jun 08 2018

Keywords

Examples

			For n = 7, the a(7) = 4 Heronian triangles with perimeter A051518(7) = 36 are:
the 10-13-13 isosceles triangle (area 60),
the 10-10-16 isosceles triangle (area 48),
the  9-12-15 scalene   triangle (area 54), and
the  9-10-17 scalene   triangle (area 36).
		

Crossrefs

Programs

  • Mathematica
    htc[p_] := Block[{t=0, c, q=p/2}, Do[c=p-a-b; If[c >= b && a+c > b && a+b > c && IntegerQ[Sqrt[q (q-a) (q-b) (q-c)]], t++], {a, p/3}, {b, a, p-a-1}]; t]; Select[htc /@ (Range[128] 2), # > 0 &] (* Giovanni Resta, Jun 14 2018 *)

Formula

a(n) = A051516(A051518(n)).

A024153 Number of integer-sided triangles with sides a,b,c, a

Original entry on oeis.org

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

Views

Author

Keywords

Comments

No such triangles with odd perimeter (see A051516).
Records occur at: 1, 12, 36, 54, 84, 108, 192, 216, 294, 324, 378, 420, 432, 540, 588, 756, 972, 1176, 1452, 1764, 1944, 2028, 2352, 2904, 2916, 3024, 3072, 3402, 3468, 3780, 3888, 4116, 5292, 6348, 6804, 8748, 10164, ... - Antti Karttunen, Sep 25 2018

Crossrefs

Programs

  • PARI
    A024153(n) = if(n%2,0,my(k=0, t, p=n/2); for(a=1,n,for(b=1+max(a,(p-a)),n-(a+1),my(c=n-(a+b)); if((c<=b),break); if(((t = (p*(p-a)*(p-b)*(p-c))) > 0)&&issquare(t),k++))); (k)); \\ Antti Karttunen, Sep 25 2018

Extensions

a(100) corrected by Seiichi Manyama, Sep 13 2018

A330912 Sum of the smallest side lengths of all Heronian triangles with perimeter A051518(n).

Original entry on oeis.org

3, 5, 5, 6, 5, 14, 38, 8, 20, 11, 37, 29, 43, 7, 31, 64, 11, 17, 37, 84, 19, 15, 70, 130, 22, 87, 101, 133, 122, 38, 241, 25, 149, 25, 111, 123, 225, 39, 220, 54, 120, 327, 254, 57, 103, 162, 227, 371, 41, 321, 34, 43, 29, 278, 373, 76, 70, 95, 577, 567, 157, 476, 221
Offset: 1

Views

Author

Wesley Ivan Hurt, May 02 2020

Keywords

Examples

			a(1) = 3; there is one Heronian triangle with perimeter A051518(1) = 12, which is [3,4,5] and its smallest side length is 3.
a(6) = 14; there are two Heronian triangles with perimeter A051518(6) = 32, [4,13,15] and [10,10,12]. The sum is 4 + 10 = 14.
		

Crossrefs

Formula

a(n) = Sum_{k=1..floor(c(n)/3)} Sum_{i=k..floor((c(n)-k)/2)} sign(floor((i+k)/(c(n)-i-k+1))) * chi(sqrt((c(n)/2)*(c(n)/2-i)*(c(n)/2-k)*(c(n)/2-(c(n)-i-k)))) * k, where chi(n) = 1 - ceiling(n) + floor(n) and c(n) = A051518(n). - Wesley Ivan Hurt, May 12 2020

A330915 Sum of the "middle" side lengths (b such that a <= b <= c) of all Heronian triangles with perimeter A051518(n).

Original entry on oeis.org

4, 5, 5, 8, 12, 23, 45, 15, 29, 13, 48, 30, 77, 24, 69, 117, 25, 25, 46, 119, 20, 26, 110, 246, 26, 167, 172, 205, 169, 79, 468, 33, 229, 38, 222, 167, 429, 41, 429, 101, 270, 560, 416, 100, 153, 276, 390, 717, 50, 615, 61, 61, 60, 404, 634, 214, 130, 130, 1033, 975, 382
Offset: 1

Views

Author

Wesley Ivan Hurt, May 02 2020

Keywords

Examples

			a(1) = 4; there is one Heronian triangle with perimeter A051518(1) = 12, which is [3,4,5] and its "middle" side length is 4.
a(6) = 23; there are two Heronian triangles with perimeter A051518(6) = 32, [4,13,15] and [10,10,12]. The sum is 13 + 10 = 23.
		

Crossrefs

Formula

a(n) = Sum_{k=1..floor(c(n)/3)} Sum_{i=k..floor((c(n)-k)/2)} sign(floor((i+k)/(c(n)-i-k+1))) * chi(sqrt((c(n)/2)*(c(n)/2-i)*(c(n)/2-k)*(c(n)/2-(c(n)-i-k)))) * i, where chi(n) = 1 - ceiling(n) + floor(n) and c(n) = A051518(n). - Wesley Ivan Hurt, May 12 2020
Showing 1-10 of 30 results. Next