<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Euler Problem 16</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: tomriddle</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-37963</link>
		<dc:creator>tomriddle</dc:creator>
		<pubDate>Sun, 15 Feb 2009 13:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-37963</guid>
		<description>&lt;p&gt;I have been Working on the same problems using VBScript only. You know, VBS files running under windows scripting host. The syntax is similar to VBA i.e. translates with only slight tweaks. My solution for problem 16 runs .4 of a sec longer than yours, not sure if that is because of the scripting engine or some other difference in the code. Anyway I have solved over 25 of these problems with VBScript now if any of you are interested. It is interesting looking at how someone else solved the same problem especially if their version is drastically faster. &lt;/p&gt;
&lt;p&gt;Problem 18 and 67 are a good example. My brute force code on 18 takes longer than my elegant code on 67 which is essentially the same problem only larger.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I have been Working on the same problems using VBScript only. You know, VBS files running under windows scripting host. The syntax is similar to VBA i.e. translates with only slight tweaks. My solution for problem 16 runs .4 of a sec longer than yours, not sure if that is because of the scripting engine or some other difference in the code. Anyway I have solved over 25 of these problems with VBScript now if any of you are interested. It is interesting looking at how someone else solved the same problem especially if their version is drastically faster. </p>
<p>Problem 18 and 67 are a good example. My brute force code on 18 takes longer than my elegant code on 67 which is essentially the same problem only larger.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36843</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 05 Jan 2009 04:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36843</guid>
		<description>&lt;p&gt;Hi Jay -&lt;/p&gt;
&lt;p&gt;My approach is just the opposite, and that&#039;s the appeal of Euleryou and I are after different things.  I&#039;ve done 41, and about half were prototyped in a spreadsheet and then moved on to VBA.  The spreadsheet graphic allows me to visualize the arrays (key examples would be the triangles of Problems 18 and 67) and gives me insight to the code.  I started this to expand my coding.  I never coded the opening of a file in VBA before I started Euler.&lt;/p&gt;
&lt;p&gt;301 columns?  That&#039;s cheating... ;-)&lt;/p&gt;
&lt;p&gt;...mrt&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Jay -</p>
<p>My approach is just the opposite, and that&#8217;s the appeal of Euleryou and I are after different things.  I&#8217;ve done 41, and about half were prototyped in a spreadsheet and then moved on to VBA.  The spreadsheet graphic allows me to visualize the arrays (key examples would be the triangles of Problems 18 and 67) and gives me insight to the code.  I started this to expand my coding.  I never coded the opening of a file in VBA before I started Euler.</p>
<p>301 columns?  That&#8217;s cheating&#8230; <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>&#8230;mrt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Sultan</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36803</link>
		<dc:creator>Jay Sultan</dc:creator>
		<pubDate>Sat, 03 Jan 2009 04:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36803</guid>
		<description>&lt;p&gt;I think using VB code in Excel violets the very fun aspect of Project Euler.  I am trying to solve all of the problem using normal Excel functions (I have been coding for 30 years and find it fun to twist Excel to do this stuff.  The basic problem is that an excel cell only has 15 digits of precision (by using a VB long you escape this problem).  &lt;/p&gt;
&lt;p&gt;My solution, which only took about 3 minutes to write, is to &quot;build&quot; the answer over multiple columns, one column for each digit of the answer.&lt;/p&gt;
&lt;p&gt;Imagine that row 1 holds 2 ** 1, row 2 is 2 ** 2, etc.  I calculated 2 ** n in the normal way in column a - at row 48 (2 ** 49), the answer is  562,949,953,421,312, which has 15 digits and is the biggest number you can get before losing precision.&lt;/p&gt;
&lt;p&gt;So, in column C, I calculate the last digit of the answer.  This is done by seeding a &#039;2&#039; in column C1 and calculating the 999 rows below as &#039;=mod(cell above me*2, 10).  This will work fine for all 1,000 rows, but it is only the last digit - I need a way to calculate the other digits.&lt;/p&gt;
&lt;p&gt;So, I copied the following formula &#039;=MOD((2*cell above me)+IF(cell above me and one to the left*2&gt;=10,1,0),10)&#039; to the range d4...ku1000.  I used this range because a) you have to skip the top three rows where there is only one digit (2, 4, 8) and the answer to =power(2, 1000) is 1.07E+301, so I went out 305 positions just to be safe (D ... KU is 305 columns).  &lt;/p&gt;
&lt;p&gt;This formula basically looks to see if we need to carry the one.&lt;/p&gt;
&lt;p&gt;Using the approach, it built my answer in 301 columns of row 1000.  The only hard part is that you have to read the number left to right (backwards), but it is easy to calculate =sum(d1000 .. ku 1000) for the answer.&lt;/p&gt;
&lt;p&gt;Has anyone else tried to solve all of these using basic Excel?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I think using VB code in Excel violets the very fun aspect of Project Euler.  I am trying to solve all of the problem using normal Excel functions (I have been coding for 30 years and find it fun to twist Excel to do this stuff.  The basic problem is that an excel cell only has 15 digits of precision (by using a VB long you escape this problem).  </p>
<p>My solution, which only took about 3 minutes to write, is to &#8220;build&#8221; the answer over multiple columns, one column for each digit of the answer.</p>
<p>Imagine that row 1 holds 2 ** 1, row 2 is 2 ** 2, etc.  I calculated 2 ** n in the normal way in column a &#8211; at row 48 (2 ** 49), the answer is  562,949,953,421,312, which has 15 digits and is the biggest number you can get before losing precision.</p>
<p>So, in column C, I calculate the last digit of the answer.  This is done by seeding a &#8217;2&#8242; in column C1 and calculating the 999 rows below as &#8216;=mod(cell above me*2, 10).  This will work fine for all 1,000 rows, but it is only the last digit &#8211; I need a way to calculate the other digits.</p>
<p>So, I copied the following formula &#8216;=MOD((2*cell above me)+IF(cell above me and one to the left*2&gt;=10,1,0),10)&#8217; to the range d4&#8230;ku1000.  I used this range because a) you have to skip the top three rows where there is only one digit (2, 4, <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> and the answer to =power(2, 1000) is 1.07E+301, so I went out 305 positions just to be safe (D &#8230; KU is 305 columns).  </p>
<p>This formula basically looks to see if we need to carry the one.</p>
<p>Using the approach, it built my answer in 301 columns of row 1000.  The only hard part is that you have to read the number left to right (backwards), but it is easy to calculate =sum(d1000 .. ku 1000) for the answer.</p>
<p>Has anyone else tried to solve all of these using basic Excel?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36725</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 29 Dec 2008 15:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36725</guid>
		<description>&lt;p&gt;Hi Tushar - (Do I have that right?)&lt;/p&gt;
&lt;p&gt;I look forward to your &quot;large&quot; functions.  My attempt at multiplication has two virtues:  (1) it&#039;s accurate and (2) it&#039;s slow.  It&#039;ll never meet any standards for Euler time.&lt;/p&gt;
&lt;p&gt;I can see nothing but good stuff on your webpages.  Thank you for making a Euler page.&lt;/p&gt;
&lt;p&gt;...best, Michael (well known for wasting people&#039;s time ;-) )&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Tushar &#8211; (Do I have that right?)</p>
<p>I look forward to your &#8220;large&#8221; functions.  My attempt at multiplication has two virtues:  (1) it&#8217;s accurate and (2) it&#8217;s slow.  It&#8217;ll never meet any standards for Euler time.</p>
<p>I can see nothing but good stuff on your webpages.  Thank you for making a Euler page.</p>
<p>&#8230;best, Michael (well known for wasting people&#8217;s time <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36706</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Sun, 28 Dec 2008 09:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36706</guid>
		<description>&lt;p&gt;Hi Michael,&lt;/p&gt;
&lt;p&gt;Thanks for getting me hooked on yet other way to spend (waste, some might call it) my time. {grin}&lt;/p&gt;
&lt;p&gt;I wrote a set of functions LargeAdd, LargeMult (requires LargeAdd), LargePower, and LargeFactorial (the last two require LargeMult) that work with numbers with more than 15 significant digits.  But, before I share my take on Problem 16, I&#039;d like to start with my solutions to other problems.  Of course, what I share is not as much the solution as a road map to the solution.&lt;/p&gt;
&lt;p&gt;The list of what I have solved (in the sense that the Project Euler website accepts my answer) and written up the solution is at&lt;br&gt;
Project Euler Problems&lt;br&gt;
&lt;a href=&quot;http://www.tushar-mehta.com/misc_tutorials/project_euler/&quot; rel=&quot;nofollow&quot;&gt;http://www.tushar-mehta.com/misc_tutorials/project_euler/&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Michael,</p>
<p>Thanks for getting me hooked on yet other way to spend (waste, some might call it) my time. {grin}</p>
<p>I wrote a set of functions LargeAdd, LargeMult (requires LargeAdd), LargePower, and LargeFactorial (the last two require LargeMult) that work with numbers with more than 15 significant digits.  But, before I share my take on Problem 16, I&#8217;d like to start with my solutions to other problems.  Of course, what I share is not as much the solution as a road map to the solution.</p>
<p>The list of what I have solved (in the sense that the Project Euler website accepts my answer) and written up the solution is at<br />
Project Euler Problems<br />
<a href="http://www.tushar-mehta.com/misc_tutorials/project_euler/" rel="nofollow">http://www.tushar-mehta.com/misc_tutorials/project_euler/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36612</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 23 Dec 2008 18:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36612</guid>
		<description>&lt;p&gt;dbb- Thank you.  Problem 31 was one of those where I understood the question, but didn&#039;t have a clue about the coding.  Now that I have a clue (and have shamelessly jacked up my Euler total), if I copy your code and start a new Problem 31 thread, will you come back and leave us a paragraph or two about how you visualized the problem and the overlay of your approach over in that thread?  I frankly don&#039;t have may arms around that part.&lt;/p&gt;
&lt;p&gt;...Michael (Blessings of the season to all)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>dbb- Thank you.  Problem 31 was one of those where I understood the question, but didn&#8217;t have a clue about the coding.  Now that I have a clue (and have shamelessly jacked up my Euler total), if I copy your code and start a new Problem 31 thread, will you come back and leave us a paragraph or two about how you visualized the problem and the overlay of your approach over in that thread?  I frankly don&#8217;t have may arms around that part.</p>
<p>&#8230;Michael (Blessings of the season to all)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Jenkins</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36594</link>
		<dc:creator>Doug Jenkins</dc:creator>
		<pubDate>Tue, 23 Dec 2008 08:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36594</guid>
		<description>&lt;p&gt;dbb - I promised myself that I was going to work it out for myself, but then I saw your code and coudn&#039;t resist trying it.&lt;/p&gt;
&lt;p&gt;I wouldn&#039;t really call it brute force.  There was a real brute force one in the discussion which just tries every feasible combination of the coins, and counts the ones that add up to 200.  I converted that from Java to VBA and started it about five minutes ago, and it&#039;s still running.&lt;/p&gt;
&lt;p&gt;I might try it in Fortran and see if it completes within the time limit.&lt;/p&gt;
&lt;p&gt;I thought the Haskell and Mathematica examples that do this in 2 or 3 lines were just annoying :)&lt;/p&gt;
&lt;p&gt;Might have a go at trying to work out how they do it over Christmas.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>dbb &#8211; I promised myself that I was going to work it out for myself, but then I saw your code and coudn&#8217;t resist trying it.</p>
<p>I wouldn&#8217;t really call it brute force.  There was a real brute force one in the discussion which just tries every feasible combination of the coins, and counts the ones that add up to 200.  I converted that from Java to VBA and started it about five minutes ago, and it&#8217;s still running.</p>
<p>I might try it in Fortran and see if it completes within the time limit.</p>
<p>I thought the Haskell and Mathematica examples that do this in 2 or 3 lines were just annoying <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Might have a go at trying to work out how they do it over Christmas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbb</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36583</link>
		<dc:creator>dbb</dc:creator>
		<pubDate>Mon, 22 Dec 2008 23:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36583</guid>
		<description>&lt;p&gt;I agree about the algorithms, a good insight/trick makes all the difference. This is my solution for problem 31, brute force but it works.&lt;/p&gt;
&lt;p&gt;Sub P31() &lt;/p&gt;
&lt;p&gt;Dim P1 As Long, P2 As Long, P5 As Long, P10 As Long, P20 As Long, P50 As Long, P100 As Long, P200 As Long&lt;br&gt;
Dim n1 As Long, n2 As Long, n5 As Long, n10 As Long, n20 As Long, n50 As Long, n100 As Long, n200 As Long&lt;br&gt;
Dim n As Long&lt;br&gt;
For P1 = 0 To 200 Step 1&lt;br&gt;
  n1 = P1&lt;br&gt;
  For P2 = 0 To 200 - n1 Step 2&lt;br&gt;
    n2 = n1 + P2&lt;br&gt;
    For P5 = 0 To 200 - n2 Step 5&lt;br&gt;
      n5 = n2 + P5&lt;br&gt;
      For P10 = 0 To 200 - n5 Step 10&lt;br&gt;
        n10 = n5 + P10&lt;br&gt;
        For P20 = 0 To 200 - n10 Step 20&lt;br&gt;
          n20 = n10 + P20&lt;br&gt;
          For P50 = 0 To 200 - n20 Step 50&lt;br&gt;
            n50 = n20 + P50&lt;br&gt;
            For P100 = 0 To 200 - n50 Step 100&lt;br&gt;
              n100 = n50 + P100&lt;br&gt;
              For P200 = 0 To 200 - n100 Step 200&lt;br&gt;
                If n100 + P200 = 200 Then&lt;br&gt;
                  n = n + 1&lt;br&gt;
                End If&lt;br&gt;
              Next P200&lt;br&gt;
            Next P100&lt;br&gt;
          Next P50&lt;br&gt;
        Next P20&lt;br&gt;
      Next P10&lt;br&gt;
    Next P5&lt;br&gt;
  Next P2&lt;br&gt;
Next P1&lt;br&gt;
Debug.Print n&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I agree about the algorithms, a good insight/trick makes all the difference. This is my solution for problem 31, brute force but it works.</p>
<p>Sub P31() </p>
<p>Dim P1 As Long, P2 As Long, P5 As Long, P10 As Long, P20 As Long, P50 As Long, P100 As Long, P200 As Long<br />
Dim n1 As Long, n2 As Long, n5 As Long, n10 As Long, n20 As Long, n50 As Long, n100 As Long, n200 As Long<br />
Dim n As Long<br />
For P1 = 0 To 200 Step 1<br />
  n1 = P1<br />
  For P2 = 0 To 200 &#8211; n1 Step 2<br />
    n2 = n1 + P2<br />
    For P5 = 0 To 200 &#8211; n2 Step 5<br />
      n5 = n2 + P5<br />
      For P10 = 0 To 200 &#8211; n5 Step 10<br />
        n10 = n5 + P10<br />
        For P20 = 0 To 200 &#8211; n10 Step 20<br />
          n20 = n10 + P20<br />
          For P50 = 0 To 200 &#8211; n20 Step 50<br />
            n50 = n20 + P50<br />
            For P100 = 0 To 200 &#8211; n50 Step 100<br />
              n100 = n50 + P100<br />
              For P200 = 0 To 200 &#8211; n100 Step 200<br />
                If n100 + P200 = 200 Then<br />
                  n = n + 1<br />
                End If<br />
              Next P200<br />
            Next P100<br />
          Next P50<br />
        Next P20<br />
      Next P10<br />
    Next P5<br />
  Next P2<br />
Next P1<br />
Debug.Print n</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Jenkins</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36582</link>
		<dc:creator>Doug Jenkins</dc:creator>
		<pubDate>Mon, 22 Dec 2008 23:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36582</guid>
		<description>&lt;p&gt;I&#039;ve done up to 32 using Excel and VBA.  Mostly VBA, but a few work well with a pure spreadsheet solution.  For the 2^1000 problem I set up an array of integers for each digit of the number, rather than working on a string.  Probably not very efficient, but it works.&lt;/p&gt;
&lt;p&gt;For some reason I found number 31 difficult and haven&#039;t solved it yet (and no time at the moment).&lt;/p&gt;
&lt;p&gt;I noticed the anti-VBA bias as well.  I also noticed some compiled solutions that took hours that were solvable in less than a second.  The algorithm is much more important than the programming language with these things.&lt;/p&gt;
&lt;p&gt;Anyone wanting a VBA prime number generator might like to have a look here:&lt;br&gt;
&lt;a href=&quot;http://newtonexcelbach.wordpress.com/2008/11/18/finding-prime-numbers-with-excel-and-using-array-&quot; rel=&quot;nofollow&quot;&gt;http://newtonexcelbach.wordpress.com/2008/11/18/finding-prime-numbers-with-excel-and-using-array-&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve done up to 32 using Excel and VBA.  Mostly VBA, but a few work well with a pure spreadsheet solution.  For the 2^1000 problem I set up an array of integers for each digit of the number, rather than working on a string.  Probably not very efficient, but it works.</p>
<p>For some reason I found number 31 difficult and haven&#8217;t solved it yet (and no time at the moment).</p>
<p>I noticed the anti-VBA bias as well.  I also noticed some compiled solutions that took hours that were solvable in less than a second.  The algorithm is much more important than the programming language with these things.</p>
<p>Anyone wanting a VBA prime number generator might like to have a look here:<br />
<a href="http://newtonexcelbach.wordpress.com/2008/11/18/finding-prime-numbers-with-excel-and-using-array-" rel="nofollow">http://newtonexcelbach.wordpress.com/2008/11/18/finding-prime-numbers-with-excel-and-using-array-</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbb</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/22/euler-problem-16/#comment-36578</link>
		<dc:creator>dbb</dc:creator>
		<pubDate>Mon, 22 Dec 2008 21:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1924#comment-36578</guid>
		<description>&lt;p&gt;VBA can do this much quicker still. I am also using it to do the Euler problems, and wrote a &quot;BigMultiply&quot; function to multiply huge numbers together, which is needed for some later problems.&lt;/p&gt;
&lt;p&gt;It is faster than your AddAsStrings because instead of working character by character, it breaks the numbers into chunks of 7 chars which can be multiplied normally, then the chunks are combined.&lt;/p&gt;
&lt;p&gt;But the real key to speed is to start by calculating 2^40 normally, then incrementing it as shown below, to reduce the number of arithmetic operations.&lt;/p&gt;
&lt;p&gt;k = 2 ^ 40&lt;br&gt;
S = CStr(k)&lt;br&gt;
s1 = BigMultiply(S, S) &#039;80&lt;br&gt;
s1 = BigMultiply(s1, S) &#039;120&lt;br&gt;
s1 = BigMultiply(s1, 32) &#039;125&lt;br&gt;
s1 = BigMultiply(s1, s1) &#039;250&lt;br&gt;
s1 = BigMultiply(s1, s1) &#039;500&lt;br&gt;
s1 = BigMultiply(s1, s1) &#039;1000&lt;/p&gt;
&lt;p&gt;I have quite a number of the problems solved, and am stuck on others, and I am happy to share, especially helper functions like prime number tests that are needed quite often.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>VBA can do this much quicker still. I am also using it to do the Euler problems, and wrote a &#8220;BigMultiply&#8221; function to multiply huge numbers together, which is needed for some later problems.</p>
<p>It is faster than your AddAsStrings because instead of working character by character, it breaks the numbers into chunks of 7 chars which can be multiplied normally, then the chunks are combined.</p>
<p>But the real key to speed is to start by calculating 2^40 normally, then incrementing it as shown below, to reduce the number of arithmetic operations.</p>
<p>k = 2 ^ 40<br />
S = CStr(k)<br />
s1 = BigMultiply(S, S) &#8217;80<br />
s1 = BigMultiply(s1, S) &#8217;120<br />
s1 = BigMultiply(s1, 32) &#8217;125<br />
s1 = BigMultiply(s1, s1) &#8217;250<br />
s1 = BigMultiply(s1, s1) &#8217;500<br />
s1 = BigMultiply(s1, s1) &#8217;1000</p>
<p>I have quite a number of the problems solved, and am stuck on others, and I am happy to share, especially helper functions like prime number tests that are needed quite often.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

