LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Palindromic Numbers Consisting of the Product of Two 3-digit Numbers

Solved!
Go to solution

@jcarmody wrote:

I'm in the high 30's, now...


That's the best I was able to get. 3 ms is sure hard to beat 🙂

 

Ben64

0 Kudos
Message 11 of 29
(1,517 Views)

@jcarmody wrote:

I'm in the high 30's, now...


I cut it in half. 🙂  I wonder if the string conversion is the bottleneck?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 12 of 29
(1,505 Views)
I was using string conversion too. The rest of the code just needs to be a little smarter. 🙂
Message 13 of 29
(1,490 Views)

I made it. 

 

Example_VI_FP.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 14 of 29
(1,481 Views)

@jcarmody wrote:

I made it. 


I guess you should go back to the drawing board. On a more modern computer mine is well below 0.8ms (now on a 3.1GHz CPU, most likley even faster on a current generation CPU). Only using one core.

 

Remember, the 3ms was on an ancient laptop. 😄

 

0 Kudos
Message 15 of 29
(1,466 Views)

altenbach wrote:

 

I guess you should go back to the drawing board. On a more modern computer mine is well below 0.8ms (now on a 3.1GHz CPU, most likley even faster on a current generation CPU). Only using one core.

 

Remember, the 3ms was on an ancient laptop. 😄


I was happy to do better than brute-force.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 16 of 29
(1,448 Views)

I'm hitting 0.22 ms (single core) by observing that all 6 digit palindromes are multiples of 11, by not using string compare, not bothing to do a palindrome check for any products smaller than my currently largest product, and by starting from 999 and working backwards.

Message 17 of 29
(1,414 Views)

@Oligarlicky wrote:

I'm hitting 0.22 ms (single core) by observing that all 6 digit palindromes are multiples of 11,....


Ah, did not know that. OK, if I include that test, mine drops to 0.12ms (Still using string compare, though)  😄

0 Kudos
Message 18 of 29
(1,407 Views)

@Oligarlicky wrote:

[...] by observing that all 6 digit palindromes are multiples of 11 [...]


That's what I was waiting for.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 19 of 29
(1,398 Views)

I'm noticing some weird stuff depending on how I benchmark. If I stick it all in a for loop I can hit ~2 ns/ itteration. To be fair, I'm only doing 256 palindrome checks in my search (everything else gets filtered out).

0 Kudos
Message 20 of 29
(1,344 Views)