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.

A189978 Number of isosceles triangles, distinct up to congruence, on an n X n grid (or geoboard).

This page as a plain text file.
%I A189978 #20 May 28 2021 20:53:46
%S A189978 0,1,5,11,22,35,53,70,100,126,159,188,237,276,328,372,439,491,564,623,
%T A189978 706,775,859,931,1049,1129,1231,1323,1448,1540,1674,1772,1928,2041,
%U A189978 2183,2301,2483,2602,2758,2898,3095
%N A189978 Number of isosceles triangles, distinct up to congruence, on an n X n grid (or geoboard).
%H A189978 Alec Jones, <a href="/A189978/a189978.jpg">Examples for n = 1 to 5</a>
%H A189978 Alec Jones, <a href="/A189978/a189978.txt">Example for n = 24</a>
%e A189978 For n=3 the five isosceles triangles are:
%e A189978 **.  *.*  .*.  ..*  *..
%e A189978 *..  ...  *..  *..  ..*
%e A189978 ...  *..  .*.  ..*  .*.
%p A189978 Triangles:=proc(n) local TriangleSet,i,j,k,l,A,B,C; TriangleSet:={}: for i from 0 to n do for j from 0 to n do for k from 0 to n do for l from 0 to n do A:=i^2+j^2: B:=k^2+l^2: C:=(i-k)^2+(j-l)^2: if A^2+B^2+C^2<>2*(A*B+B*C+C*A) then TriangleSet:={op(TriangleSet),sort([sqrt(A),sqrt(B),sqrt(C)])}: fi: od: od: od: od: return(TriangleSet); end:
%p A189978 IsIsoscelesTriangle:=proc(T) if T[1]=T[2] or T[1]=T[3] or T[2]=T[3] then true else false fi: end:
%p A189978 a:=proc(n) local TriangleSet,IsoscelesTriangleSet,i;
%p A189978 TriangleSet:=Triangles(n): IsoscelesTriangleSet:={}: for i from 1 to nops(TriangleSet) do if IsIsoscelesTriangle(TriangleSet[i]) then IsoscelesTriangleSet:={op(IsoscelesTriangleSet),TriangleSet[i]} fi: od: return(nops(IsoscelesTriangleSet)); end:
%Y A189978 Cf. A028419, A186434.
%K A189978 nonn,more
%O A189978 1,3
%A A189978 _Martin Renner_, May 03 2011
%E A189978 a(21)-a(40) from _Martin Renner_, May 08 2011