Talk:Gapful numbers: Difference between revisions

 
(2 intermediate revisions by 2 users not shown)
Line 5:
 
::I didn't even notice that. The REXX output and task requirements don't agree. This is what happens when Gerard doesn't mandate commas in the output! --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 13:26, 10 November 2019 (UTC)
 
:::To spare Gerard's blushes, let's do 'em both (and 7123) :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 18:17, 10 November 2019 (UTC)
 
:::: Yuppers.   I was thinking about mandating commas in the output,   and that would've saved me the embarrassment of goofing up my own task.   The output was from an earlier draft of the,   er ... draft task,   and I forgot to update the program and output.   The original (draft) task had an additional set of requirements,   but I elected to drop those and save them for another upcoming Rosetta Code task.   In any case, thanks for spotting the errors in my program/output.   I was trying for ranges that did a wee bit of stress testing   (I had toyed with the idea of also mandating a trillion and also using American English names instead of a numeric '''one''' followed with a whole bunch of zeros),   but settled for these three simple ranges, albeit that my REXX program didn't use two of them.     (sigh)     -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:46, 10 November 2019 (UTC)
 
== Count without testing ==
 
I'm thinking about an faster method to count gapful numbers in base 10.<BR>
For example in the 1000 numbers [1000..1999] are 218 gapful numbers.<BR>
The numbers to check divisibilty are 10 to 19<BR>
10 strikes every lcm(10,Base) 10 ,11 strikes every lcm(11,base)=110 .. 19 strikes every lcm(19,base)= 190
<pre>
LCM
10 starts 1000 -> 1000 div 10 =100 strikes 100
11 starts 1001 -> 999 div 110 = 9 strikes +1 (1001) 10
12 starts 1032 -> 968 div 60 = 16 strikes +1 17
13 starts 1053 -> 947 div 130 = 7 strikes +1 8
14 starts 1064 -> 936 div 70 = 13 strikes +1 14
15 starts 1005 -> 995 div 30 = 33 strikes +1 34
16 starts 1056 -> 944 div 80 = 11 strikes +1 12
17 starts 1037 -> 963 div 170 = 5 strikes +1 6
18 starts 1008 -> 992 div 90 = 11 strikes +1 12
19 starts 1159 -> 841 div 190 = 4 strikes +1 5
sum 218
</pre>
So i have only to find the first number and add the manyfold of the lcm in the rest.
Anonymous user