<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, A little problem</title>
    <link>http://www.mapleprimes.com/questions/127758-A-Little-Problem</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 19:32:57 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 19:32:57 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, A little problem</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, A little problem</title>
      <link>http://www.mapleprimes.com/questions/127758-A-Little-Problem</link>
    </image>
    <item>
      <title>seq?</title>
      <link>http://www.mapleprimes.com/questions/127758-A-Little-Problem?ref=Feed:MaplePrimes:A little problem:Comments#answer127759</link>
      <itunes:summary>&lt;p&gt;One way is to use seq instead:&lt;br&gt;seq(i^2,i=1..10);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;One way is to use seq instead:&lt;br&gt;seq(i^2,i=1..10);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>127759</guid>
      <pubDate>Tue, 15 Nov 2011 17:40:58 Z</pubDate>
      <itunes:author>ThU</itunes:author>
      <author>ThU</author>
    </item>
    <item>
      <title>Another approach</title>
      <link>http://www.mapleprimes.com/questions/127758-A-Little-Problem?ref=Feed:MaplePrimes:A little problem:Comments#answer127777</link>
      <itunes:summary>&lt;p&gt;It is useful to have a few solutions.&lt;br&gt;&amp;gt; L := [];&lt;br&gt;&amp;gt; for j to 4 do L := [op(L), j^2] end do:&lt;br&gt;&amp;gt; L;&lt;br&gt;[1, 4, 9, 16]&lt;br&gt;S := convert(L, set);&lt;br&gt;{1, 4, 9, 16}&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;It is useful to have a few solutions.&lt;br&gt;&amp;gt; L := [];&lt;br&gt;&amp;gt; for j to 4 do L := [op(L), j^2] end do:&lt;br&gt;&amp;gt; L;&lt;br&gt;[1, 4, 9, 16]&lt;br&gt;S := convert(L, set);&lt;br&gt;{1, 4, 9, 16}&lt;/p&gt;</description>
      <guid>127777</guid>
      <pubDate>Tue, 15 Nov 2011 23:03:40 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
    <item>
      <title>It is Ok</title>
      <link>http://www.mapleprimes.com/questions/127758-A-Little-Problem?ref=Feed:MaplePrimes:A little problem:Comments#answer127784</link>
      <itunes:summary>&lt;p&gt;Thanks for both of you !&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks for both of you !&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>127784</guid>
      <pubDate>Wed, 16 Nov 2011 06:13:19 Z</pubDate>
      <itunes:author>Fei Wang</itunes:author>
      <author>Fei Wang</author>
    </item>
    <item>
      <title>timing</title>
      <link>http://www.mapleprimes.com/questions/127758-A-Little-Problem?ref=Feed:MaplePrimes:A little problem:Comments#comment133998</link>
      <itunes:summary>&lt;p&gt;This is one of the archetypal (avoidable) inefficient programming techniques in Maple -- to build a list by concatenation which is a worse complexity class than using `seq`.&lt;/p&gt;
&lt;p&gt;The significant consequence is that the timing disadvantage is a function of the number of elements created. The performance of list concatenation gets even worse relative to that of using `seq` as the problem size increases.&lt;/p&gt;
&lt;pre&gt;restart:
st:=time():
  K:=[seq(i^2,i=1..10^4)]:
time()-st;
                               0.

st :=time():
L := []:
for j to 10^4 do L := [op(L), j^2] end do:
time()-st;
                             0.960

evalb(K=L);
                              true

restart:
st:=time():
  K:=[seq(i^2,i=1..10^5)]:
time()-st;
                             0.020

restart:
st :=time():
L := []:
for j to 10^5 do L := [op(L), j^2] end do:
time()-st;
                             93.780
&lt;/pre&gt;
&lt;p&gt;Above, the timing of list concatenation got worse by a factor of approximately 100 when the problem size was increased by a factor of 10.&lt;/p&gt;
&lt;p&gt;But `seq` slows down by not too much more than the factor by which the problem size increases (up until much larger sizes, at least).&lt;/p&gt;
&lt;pre&gt;restart:
st:=time():
  K:=[seq(i^2,i=1..10^6)]:
time()-st;
                             0.170

restart:
st:=time():
  K:=[seq(i^2,i=1..10^7)]:
time()-st;
                             1.850
&lt;/pre&gt;
&lt;p&gt;The inefficiency is not only for timing. It is also for the total memory allocation.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;This is one of the archetypal (avoidable) inefficient programming techniques in Maple -- to build a list by concatenation which is a worse complexity class than using `seq`.&lt;/p&gt;
&lt;p&gt;The significant consequence is that the timing disadvantage is a function of the number of elements created. The performance of list concatenation gets even worse relative to that of using `seq` as the problem size increases.&lt;/p&gt;
&lt;pre&gt;restart:
st:=time():
  K:=[seq(i^2,i=1..10^4)]:
time()-st;
                               0.

st :=time():
L := []:
for j to 10^4 do L := [op(L), j^2] end do:
time()-st;
                             0.960

evalb(K=L);
                              true

restart:
st:=time():
  K:=[seq(i^2,i=1..10^5)]:
time()-st;
                             0.020

restart:
st :=time():
L := []:
for j to 10^5 do L := [op(L), j^2] end do:
time()-st;
                             93.780
&lt;/pre&gt;
&lt;p&gt;Above, the timing of list concatenation got worse by a factor of approximately 100 when the problem size was increased by a factor of 10.&lt;/p&gt;
&lt;p&gt;But `seq` slows down by not too much more than the factor by which the problem size increases (up until much larger sizes, at least).&lt;/p&gt;
&lt;pre&gt;restart:
st:=time():
  K:=[seq(i^2,i=1..10^6)]:
time()-st;
                             0.170

restart:
st:=time():
  K:=[seq(i^2,i=1..10^7)]:
time()-st;
                             1.850
&lt;/pre&gt;
&lt;p&gt;The inefficiency is not only for timing. It is also for the total memory allocation.&lt;/p&gt;</description>
      <guid>133998</guid>
      <pubDate>Wed, 09 May 2012 22:59:48 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
  </channel>
</rss>