Difference between revisions of "2002 PMWC Problems"

(Problem T10)
(Problem I13)
Line 48: Line 48:
  
 
== Problem I13 ==
 
== Problem I13 ==
 +
 +
<asy>
 +
size(8cm);
 +
int[][] triangle;
 +
int nrows=5;
 +
int count = 1;
 +
for(int i = 0; i < nrows; ++i)
 +
{
 +
int[] temp;
 +
for(int j = 0; j <= i; ++j)
 +
{
 +
temp.push(count);
 +
count+=2;
 +
}
 +
triangle.push(temp);
 +
}
 +
for(int i = 0; i < nrows; ++i)
 +
{
 +
for(int j = 0; j <= i; ++j)
 +
{
 +
label( string(triangle[i][j]), (-i/2+j,-i*sqrt(3)/2) );
 +
}
 +
}
 +
real correction=.175;
 +
string[] ord = {"st", "nd", "rd"};
 +
while(ord.length < nrows)
 +
{
 +
ord.push("th");
 +
}
 +
for(int i = 1; i <= nrows; ++i)
 +
{
 +
label("$" + string(i) + "^\textrm{" + ord[i-1] + "}$ Row:", (-5,(-i+1)*sqrt(3)/2+correction));
 +
}
 +
int orows=3;
 +
real cradius=.07;
 +
for(int i = nrows; i < orows + nrows; ++i)
 +
{
 +
for(int j = 0; j <= i; ++j)
 +
{
 +
fill( circle((-i/2+j,-i*sqrt(3)/2), cradius) );
 +
}
 +
}
 +
//Credit to dasobson for the diagram</asy>
  
 
<asy>
 
<asy>

Revision as of 13:55, 20 April 2014