Skip to main content

Timeline for Prime number checksum

Current License: CC BY-SA 4.0

12 events
when toggle format what by license comment
Nov 30, 2022 at 22:04 comment added jdt That sounds like a plan.
Nov 30, 2022 at 21:58 history made wiki Post Made Community Wiki by Engineer Toast
Nov 30, 2022 at 21:57 comment added Engineer Toast @jdt That does seem to work although I had to reduce it to ROW(1:30) to get it to compute in a reasonable time. You could theoretically use ROW(A:A) to get the whole thing down to 129 bytes but it would never really finish computing, I bet. How about I make this a Wiki answer and you can go update with this confusing monster + explain how it works?
Nov 30, 2022 at 14:36 comment added jdt Invitation accepted :-) =LET(r,ROW(1:99),s,SEQUENCE(LEN(A1)),SUM((9-MID(A1,s,1))*REDUCE(-s,r,LAMBDA(a,b,IFS(SUM(0+(MOD(b,r)<1))>2,a,a<0,a+1,a,a,b,b))))+1)
Nov 29, 2022 at 18:55 comment added Engineer Toast @jdt That does make a concatenated string of primes but It's not much shorter than the solution above that creates an array. I'm not comfortable with REDUCE or LAMBDA since they're not in my version, but I invite you to flesh it out to a full solution. I'd be interested to see it in action.
Nov 29, 2022 at 17:46 comment added jdt Would something like this help with creating a list of primes? =REDUCE("",ROW(1:999),LAMBDA(a,b,a&IF(SUM(0+(MOD(b,SEQUENCE(b))<1))<3,b&",","")))
Oct 18, 2022 at 21:19 comment added Engineer Toast @jdt That inspired me to go find a solution 9 bytes shorter. Surprisingly enough, it's actually a better prime list since it doesn't include the errors at the end.
Oct 18, 2022 at 21:18 history edited Engineer Toast CC BY-SA 4.0
Saved more bytes! Shorter prime list generator.
Oct 18, 2022 at 20:17 history edited Engineer Toast CC BY-SA 4.0
Saved 1 whole byte. Victory shall be mine!
Oct 18, 2022 at 15:16 comment added math scat truly awesome indeed
Oct 17, 2022 at 19:32 history edited Engineer Toast CC BY-SA 4.0
Formatting
Oct 17, 2022 at 19:27 history answered Engineer Toast CC BY-SA 4.0