Talk:Self numbers: Difference between revisions

(→‎Go, tweaked: Responded to Enter your username.)
 
(5 intermediate revisions by 3 users not shown)
Line 9:
Now counting all selfnumbers 0..9999 than copy 10000- (max digitcount)*9 to Position 0..- (max digitcount)*9 and clear the rest to the upper limit.
This can all be done lightning fast in Level I cache. [[user Horst.h|Horst.h]] 18:20, 7 October 2020 (UTC)
:New observation using Base*Base+1 = 101. Line 0 is modified 1,3,5 are deleted<BR>
:I tought about one more time, because the CountOfSelfnumbers(n)/n ist nearly constant .<BR>
:Many same lines, changes in constant distances only a rotation of line 1 with some.
:I mark once every follower of a number by adding its sum of digits in a range of 0..9999+(max digitcount)*9.<BR>
:There shall be a build system for this pattern.
:My window size is 0..9999.<Br>
:mostly 10 out of 101 are selfnumbers, every 9*101 -2 , every 99*101 -3 , every 999*101 -4
:For the first time I count the elements 0..9999<BR>
:
:The next time I move the start of the window by one, the sum of digit in front of the four digits, for the range 10000..19999.<BR>
<pre>
:Than I move the start of the window by 2, the sum of digit in front of the four digits, for the range 20000..29999.<BR>
annotation number of self numbers up to
:....<BR>
101 13
:..by 72 ( 8*9) for 99999999_0000 to 99999999_9999<BR>
1010 103
:Now I think, i memorize the sum of self numbers (x..x+9999) at the Position 0..72, so only one time of counting is needed<Br>
10100 991
:Using the array SumOfDigits 0..9999 i can do it for that elemnents too<BR>
101000 9880
:Is it that simple? [[user:Horsth|Horsth]] [[User:Horsth|Horsth]] ([[User talk:Horsth|talk]]) 05:02, 8 October 2020 (UTC)
1010000 98761
10100000 987562
101000000 9875563
1010000000 98755565
10100000000 987555566
 
n Div 101
0 0 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
101 1 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
202 2 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
303 3 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
404 4 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
505 5 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
606 6 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
707 7 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
808 8 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
909 9 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
-- rotate <<<<<<<<<
-- v deleted
1010 10 00000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000000000010
-- v inserted
1111 11 10000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000000000010
--
1818 18 10000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000000000010
-- v
1919 19 10000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000000000000
2020 20 00100000000001000000000010000000000100000000001000000000010000000000100000000001000000000010100000000
--
2828 28 00100000000001000000000010000000000100000000001000000000010000000000100000000001000000000010100000000
-- vvv
2929 29 00100000000001000000000010000000000100000000001000000000010000000000100000000001000000000000001000000
3030 30 00001000000000010000000000100000000001000000000010000000000100000000001000000000010100000000001000000
-- vvv
3939 39 00001000000000010000000000100000000001000000000010000000000100000000001000000000000001000000000010000
4040 40 00000010000000000100000000001000000000010000000000100000000001000000000010100000000001000000000010000
--
4848 48 00000010000000000100000000001000000000010000000000100000000001000000000010100000000001000000000010000
vvv
4949 49 00000010000000000100000000001000000000010000000000100000000001000000000000001000000000010000000000100
5050 50 00000000100000000001000000000010000000000100000000001000000000010100000000001000000000010000000000100
-- vvv
5959 59 00000000100000000001000000000010000000000100000000001000000000000001000000000010000000000100000000001
6060 60 00000000001000000000010000000000100000000001000000000010100000000001000000000010000000000100000000001
-- vvv
6969 69 00000000001000000000010000000000100000000001000000000000001000000000010000000000100000000001000000000
7070 70 01000000000010000000000100000000001000000000010100000000001000000000010000000000100000000001000000000
-- vvv
7979 79 01000000000010000000000100000000001000000000000001000000000010000000000100000000001000000000010000000
8080 80 00010000000000100000000001000000000010100000000001000000000010000000000100000000001000000000010000000
-- vvv
8989 89 00010000000000100000000001000000000000001000000000010000000000100000000001000000000010000000000100000
9090 90 00000100000000001000000000010100000000001000000000010000000000100000000001000000000010000000000100000
-- V VVV
9999 99 00000100000000000000000000000000010000000000100000000001000000000010000000000100000000001000000000010
----
99889 989 01000000000010000000000100000000001000000000010100000000001000000000010000000000100000000001000000000
-- v v vvv
99990 990 01000000000010000000000000000000000000000000000000000100000000001000000000010000000000100000000001000
First line found:
..8810 matches found... last one
100992930 999930 00000001010000000000100000000001000000000010000000000100000000001000000000010000000000100000000001000
</pre>
:Is it that simple? [[user:Horsth|Horsth]] [[User:Horsth|Horsth]] ([[User talk:Horsth|talk]]) 0507:0201, 89 October 2020 (UTC)
 
== Go, tweaked ==
Line 33 ⟶ 96:
 
:Might do a separate version incorporating Horst.h's ideas as I suspect it might come in a bit slower for the basic task of 100 million numbers while allowing us to stretch that to 1 billion. But we'll see. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 09:06, 8 October 2020 (UTC)
 
::I was wrong. Horst.h's approach is not only quicker for 100 million numbers but I can't even extend the second version to do up to 1 billion numbers without running into memory issues. So I've added a third version. A little slower than Pascal but not too bad :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 12:53, 8 October 2020 (UTC)
Anonymous user