<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Code Miniatures! in BreakPoint</title>
    <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3136581#M26892</link>
    <description>&lt;P&gt;OK, here's what I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;digits size time   solution

   2    04    0ns   9009
   3    06    2us   906609
   4    08    2us   99000099
   5    10   22us   9966006699
   6    12  228us   999000000999
   7    14   63ms   99956644665999
   8    16   26ms   9999000000009999
   9    18    12s   999900665566009999 = 999920317 * 999980347&lt;/PRE&gt;
&lt;P&gt;You need to be careful about folding. When we disable debugging, the outer FOR loop gets folded and we actually get a false result (single loop time/# of iterations).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 May 2015 03:53:46 GMT</pubDate>
    <dc:creator>altenbach</dc:creator>
    <dc:date>2015-05-19T03:53:46Z</dc:date>
    <item>
      <title>Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134761#M26842</link>
      <description>&lt;P&gt;Let us define a "&lt;STRONG&gt;Code Miniature&lt;/STRONG&gt;" as code that achieves the goal with the smallest amount of code elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;(Similarly, &lt;STRONG&gt;miniature chess&amp;nbsp;puzzles&lt;/STRONG&gt;&amp;nbsp;are defined as having a very small number of pieces, typically &amp;lt;7).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course speed is important too, but is it really worth throwing 5x more code at something just to gain 5% in speed? Probably not!&lt;/P&gt;
&lt;P&gt;As it turns out, well written miniature code is typically also very efficient. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So let's start out with the problem &lt;A href="https://forums.ni.com/t5/LabVIEW/Palindromic-Numbers-Consisting-of-the-Product-of-Two-3-digit/m-p/3128918#M899104" target="_blank"&gt;discussed here&lt;/A&gt;. (&lt;A href="https://forums.ni.com/t5/BreakPoint/Happy-Palindrome-Week/m-p/3133983#U3133983" target="_blank"&gt;Appropriate for palindrome week! &lt;/A&gt;:D)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;General Problem&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Find the largest palindromic number consisting of the product of two 3-digit numbers. A panlindromic number is defined as one whose digits are the same as its reverse. For example, 99799 is the same as its reverse "99799".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Miniature version of the problem (&lt;A href="https://forums.ni.com/t5/LabVIEW/Palindromic-Numbers-Consisting-of-the-Product-of-Two-3-digit/m-p/3134741#M901378" target="_blank"&gt;details here&lt;/A&gt;)&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you solve the above problem &lt;U&gt;from first principles&lt;/U&gt; using LabVIEW code that contains exactly the following collection of functions (plus controls/indicators, benchmark skeleton, and possibly some diagram constants):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="https://forums.ni.com/ni/attachments/ni/170/901378/1/PalinElements.png" border="0" alt="" title="" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Of course it would be interesting to see of somebody can do it with even less without much loss in performance. &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/SPAN&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 19:23:51 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134761#M26842</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-14T19:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134822#M26843</link>
      <description>&lt;P&gt;Where's the string conversion??? &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.ni.com/i/smilies/16x16_smiley-surprised.gif" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ill try...&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 20:00:12 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134822#M26843</guid>
      <dc:creator>jcarmody</dc:creator>
      <dc:date>2015-05-14T20:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134827#M26844</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/78620"&gt;@jcarmody&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Where's the string conversion??? &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.ni.com/i/smilies/16x16_smiley-surprised.gif" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Don't need it. However if I use the string conversion, it slows down to about 170µs. Still pretty good, but contains a little bit more code. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 20:09:57 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134827#M26844</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-14T20:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134925#M26845</link>
      <description>&lt;P&gt;I love this format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found I couldn't really use the minimalist diagram as a starting point (deductive vs inductive reasoning or some such thing...), but I came up with my own solution&amp;nbsp;(which still uses the string conversion):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;IMG src="https://forums.ni.com/t5/image/serverpage/image-id/167169i84DD2BF92C108EC2/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Max_Palindromic_Number_Minimalist.png" title="Max_Palindromic_Number_Minimalist.png" /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you know the answer is a multiple of 11, it takes ~34 us (I'm not sure this qualifies under "first principles" or not)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, it's closer to 400 us&amp;nbsp;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://forums.ni.com/i/smilies/16x16_smiley-sad.gif" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wasn't sure how much of the performance came from just where the answer happened to fall so I went ahead and tested higher digit case (not using the multiple of 11 rule).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Palindromic numbers which are products of two &lt;STRIKE&gt;numbers&lt;/STRIKE&gt;&amp;nbsp;integers between 1000 and 9999 (max=99000099):&lt;/P&gt;
&lt;P&gt;~833&amp;nbsp;us&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 23:58:44 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134925#M26845</guid>
      <dc:creator>John_P1</dc:creator>
      <dc:date>2015-05-14T23:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134931#M26846</link>
      <description>What's your hardware?</description>
      <pubDate>Fri, 15 May 2015 00:02:30 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134931#M26846</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-15T00:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134936#M26847</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/78620"&gt;@jcarmody&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Where's the string conversion??? &lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.ni.com/i/smilies/16x16_smiley-surprised.gif" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ill try...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm guessing he uses the quotient remainder and the for loop to do the palindrome check. That's what I did.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 00:05:49 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134936#M26847</guid>
      <dc:creator>Oligarlicky</dc:creator>
      <dc:date>2015-05-15T00:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134937#M26848</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt; wrote:&lt;BR /&gt;What's your hardware?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;3.1 GHz Core i5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hastily wrote in my initial post the 5 digit case (which I edited out once I realized the answer was wrong due to requiring 64-bit integers).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I re-ran the 5 digit after changing my types to u64 and got:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;~14.2 ms&lt;/P&gt;
&lt;P&gt;(9966006699 = 99681 * 99979)&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;
&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 00:11:17 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134937#M26848</guid>
      <dc:creator>John_P1</dc:creator>
      <dc:date>2015-05-15T00:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134938#M26849</link>
      <description>Assuming we know nothing about the solution or even if one exists, robust code also needs to ensure that (1) the program always actually terminates (I.e. not stuck in an infinite loop) and (2) gives a unique answer (e.g. -1) if no solution exists. Mine does.</description>
      <pubDate>Fri, 15 May 2015 00:12:26 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134938#M26849</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-15T00:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134941#M26850</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt; wrote:&lt;BR /&gt;Assuming we know nothing about the solution or even if one exists, robust code also needs to ensure that (1) the program always actually terminates (I.e. not stuck in an infinite loop) and (2) gives a unique answer (e.g. -1) if no solution exists. Mine does.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Ditto...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hypothetically if there were no palindromic numbers at all in the 3 digit case (no 11s rule) it would take my code ~35.3 ms to execute since it has to check all of the combinations--I tested this by changing my palindrome check to always be FALSE. &amp;nbsp;I'd bet yours is probably faster since it's not doing&amp;nbsp;the string compare.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 00:21:42 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134941#M26850</guid>
      <dc:creator>John_P1</dc:creator>
      <dc:date>2015-05-15T00:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134991#M26851</link>
      <description>&lt;P&gt;That was a fun little puzzle. &amp;nbsp;I ended up using the same amount of primitive functions as Altenbach did&amp;nbsp;&amp;nbsp;but only ended up sharing 2/11 primitives which I thought was pretty interesting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I couldn't figure out what math needed to be done to check palindromeness but I thought I ended up with a neat solution that I attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also just realized that I forgot to add my main while loop to the list of functions as well meaning Altenbach has me by one item and John by two (maybe next time).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.ni.com/t5/image/serverpage/image-id/167173i108DEE2EC284E317/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Items Used.png" title="Items Used.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 04:57:38 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134991#M26851</guid>
      <dc:creator>Jacobson-ni</dc:creator>
      <dc:date>2015-05-15T04:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134996#M26852</link>
      <description>&lt;P&gt;Sorry, I can only test on my ancient laptop (~2006) at the moment, but here are some approximate times and solutions.&lt;/P&gt;
&lt;P&gt;can ayone verify if these solutions are correct? (The longer solutions use I64 of course)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;size time solution

06 129us 906609
08  60us 99000099
10 115ms 9966006699
12  30ms 999000000999
14  35s  99956644665999
16   6s  9999000000009999&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 06:27:56 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3134996#M26852</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-15T06:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135044#M26853</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/271452"&gt;@Jacobson-ni&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;That was a fun little puzzle. &amp;nbsp;I ended up using the same amount of primitive functions as Altenbach did&amp;nbsp;&amp;nbsp;but only ended up sharing 2/11 primitives which I thought was pretty interesting.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yours seems to be a few orders of magnitude slower, but you are using a completely different algorithm overall. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 08:01:35 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135044#M26853</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-15T08:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135309#M26855</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Sorry, I can only test on my ancient laptop (~2006) at the moment, but here are some approximate times and solutions.&lt;/P&gt;
&lt;P&gt;can ayone verify if these solutions are correct? (The longer solutions use I64 of course)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;size time solution

06 129us 906609
08  60us 99000099
10 115ms 9966006699
12  30ms 999000000999
14  35s  99956644665999
16   6s  9999000000009999&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Those execution times are interesting (the solutions are right as far as I can tell).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For mine (without knowing answer is a multiple of 11) I got:&lt;/P&gt;
&lt;P&gt;6: &amp;nbsp;400 us (906609 = 993 * 913)&lt;/P&gt;
&lt;P&gt;8: &amp;nbsp;833 us (&lt;SPAN&gt;99000099 = 9999 * 9901)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;10: 14.2 ms (&lt;SPAN&gt;9966006699 = 99979 * 99681)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;12: &amp;nbsp;156 ms (999000000999 = 999999 * 999001)&lt;/P&gt;
&lt;P&gt;14: &amp;nbsp;1.65 s (99956644665999&amp;nbsp;= 9998017 * 9997647)&lt;/P&gt;
&lt;P&gt;16: &amp;nbsp;19 s (9999000000009999 = 99999999 *&amp;nbsp;99990001)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours is faster when the answer happens to include&amp;nbsp;the maximum number in the range (e.g. 999999 * 999001), so I bet you're checking like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999999&lt;BR /&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999998&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999997&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999996&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;etc...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Mine is faster (for higher order cases anyway) when the answer does not include the maximum number in the range (e.g. 9998017 * 9997647). &amp;nbsp;I'm doing the check like this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;9999999 *&amp;nbsp;9999999&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;9999998 *&amp;nbsp;9999999&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;9999998 *&amp;nbsp;9999998&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;9999997 *&amp;nbsp;9999999&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;9999997 *&amp;nbsp;9999998&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;9999997 *&amp;nbsp;9999997&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;9999996 *&amp;nbsp;9999999&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;etc...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 17:48:01 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135309#M26855</guid>
      <dc:creator>John_P1</dc:creator>
      <dc:date>2015-05-15T17:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135313#M26856</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/115598"&gt;@John_P1&lt;/a&gt; wrote:&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Yours is faster when the answer happens to include&amp;nbsp;the maximum number in the range (e.g. 999999 * 999001), so I bet you're checking like this:&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999999&lt;BR /&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999998&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999997&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999996&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;etc...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Wouldn't this method possibly skip over the correct answer if we are looking for the largest number?&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 17:56:12 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135313#M26856</guid>
      <dc:creator>Jacobson-ni</dc:creator>
      <dc:date>2015-05-15T17:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135314#M26857</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/115598"&gt;@John_P1&lt;/a&gt; wrote:&lt;BR /&gt;Mine is faster (for higher order cases anyway) when the answer does not include the maximum number in the range (e.g. 9998017 * 9997647). &amp;nbsp;I'm doing the check like this:&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, there are many ways to roll the numbers and it depends where the solution is. I start both numbers from the top, but stop the current train once the product is less than the best found so far.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Here are the current numbers on my 3.1GHz Xeon. A current generation I7 would probably be quite a bit faster)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;size time solution

06  35us 906609
08  13us 99000099
10  25ms 9966006699
12   7ms 999000000999
14  13s  99956644665999
16   2s  9999000000009999&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 18:00:38 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135314#M26857</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-15T18:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135318#M26858</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/271452"&gt;@Jacobson-ni&lt;/a&gt; wrote:&lt;BR /&gt;Wouldn't this method possibly skip over the correct answer if we are looking for the largest number?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, we just need to keep the current largest and keep going until there are no larger products possible anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The full search is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999999&lt;BR /&gt;999999 *&amp;nbsp;999998&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999997&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999999 *&amp;nbsp;&lt;SPAN&gt;999996&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;etc...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999998 * 999998&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999998 * 999997&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999998 * 999996&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;etc.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999997 * 999997&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999997 * 999996&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;999997 * 999995&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;etc,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We terminate the inner loop if the product is less than the currently best. And&lt;/SPAN&gt;&amp;nbsp;terminate the outer loop (and the search!) if the square of the first number is less than the currently best.&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>
      <pubDate>Fri, 15 May 2015 18:15:28 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135318#M26858</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-15T18:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135323#M26859</link>
      <description>&lt;P&gt;Clever, I was wondering where the square fit in to the VI.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 18:21:56 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135323#M26859</guid>
      <dc:creator>Jacobson-ni</dc:creator>
      <dc:date>2015-05-15T18:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135330#M26860</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.ni.com/t5/user/viewprofilepage/user-id/271452"&gt;@Jacobson-ni&lt;/a&gt; wrote:&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Wouldn't this method possibly skip over the correct answer if we are looking for the largest number?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All numbers are tested in either algorithm (like Altenbach's, I move on to the next set&amp;nbsp;once the product is below the best found palindromic number).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The space of products&amp;nbsp;you have to check looks like this (e.g. the 2 digit case -- I blacked out the duplicates in the bottom left half of the graph):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.ni.com/t5/image/serverpage/image-id/167212i5DC875EF0E4E79A1/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Untitled 1 Front Panel _2015-05-15_13-21-00.png" title="Untitled 1 Front Panel _2015-05-15_13-21-00.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both algorithms start in the top left corner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Altenbach's moves from left to right, moving down to the next row after each row is completed (or the exit criteria is met).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mine moves from top to bottom, moving over to the next column after each column is completed (or the exit criteria is met).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My reason for slicing it this way is that the higher value products will mostly&amp;nbsp;be tested first (e.g. checking 99*10 before checking 98*98 seems inefficient to me). &amp;nbsp;As it turns out though, it is fairly common for the answer to fall on the top row so Altenbach's algorithm wins out in those cases. &amp;nbsp;I think he also has some additional tricks&amp;nbsp;to his that I am lacking (e.g. I'm still using the string conversion) that improve his performance.&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;
&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 18:32:32 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135330#M26860</guid>
      <dc:creator>John_P1</dc:creator>
      <dc:date>2015-05-15T18:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135340#M26861</link>
      <description>&lt;P&gt;I was rewriting mine in terms of Jacobsons algorithm (Checking 6 digit numbers for palinomicity :D), then see if there is a product of two 3 digit numbers. Takes about 1ms for the original 6 digit problem. Probably could be improved.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 19:09:07 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135340#M26861</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-15T19:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Code Miniatures!</title>
      <link>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135426#M26863</link>
      <description>&lt;P&gt;Yes, your oder seems different but there is no clear winner.&lt;/P&gt;
&lt;P&gt;Here are my preliminary times on the 3.1GHz Xeon for your input ordering. Still need to polish up the code....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;size time solution

06  20us 906609
08  24us 99000099
10   2ms 9966006699
12  15ms 999000000999
14 520ms 99956644665999
16   7s  9999000000009999&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A better&amp;nbsp;way might&amp;nbsp;be to sweep in a somewhat radial diagonal pattern such that the first one found is also the largest. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2015 00:19:55 GMT</pubDate>
      <guid>https://forums.ni.com/t5/BreakPoint/Code-Miniatures/m-p/3135426#M26863</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2015-05-16T00:19:55Z</dc:date>
    </item>
  </channel>
</rss>

