ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 12 Mar 2021 17:45:58 +0100numbers in numbers - divide by 2 - cyclic -algorithm comparehttps://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/We got cyclic of integers divide by 2 in number 2**n.
Example:
8192 is even number
4096 is even number 4096 is even number
2048 is even number 2048 is even number 2048 is even number
1024 is even number 1024 is even number 1024 is even number 1024 is even number
512 is even number 512 is even number 512 is even number 512 is even number
256 is even number 256 is even number 256 is even number 256 is even number
128 is even number 128 is even number 128 is even number 128 is even number
64 is even number 64 is even number 64 is even number 64 is even number
32 is even number 32 is even number 32 is even number 32 is even number
16 is even number 16 is even number 16 is even number 16 is even number
8 is even number 8 is even number 8 is even number 8 is even number
4 is even number 4 is even number 4 is even number 4 is even
2 is even number 2 is even number 2 is even number 2 is even number
1 is odd number 1 is odd number 1 is odd number 1 is odd number
second example number:
**8186 is even number 40930 is even number
4093 is odd number 20465 is odd number
4092 is even number 20464 is even number
2046 is even number 10232 is even number
1023 is odd number 5116 is even number
1022 is even number 2558 is even number
511 is odd number 1279 is odd number
510 is even number 1278 is even number
255 is odd number 639 is odd number
254 is even number 638 is even number
127 is odd number 319 is odd number
126 is even number 318 is even number
63 is odd number 159 is odd number
62 is even number 158 is even number
31 is odd number 79 is odd number
30 is even number 78 is even number
15 is odd number 39 is odd number
14 is even number 38 is even number
7 is odd number 19 is odd number
6 is even number 18 is even number
3 is odd number 9 is odd number
2 is even number 8 is even number**
1 is odd number 4 is even number
2 is even number
1 is odd number
how to analyze ciclic of divide number ? or how many ciclic are ?I mean I wuold like to perfom algorithm which will be detect probality divide number without knowing the number. it is cripto task.
for example we know that Point(X,Y) can be odd like 1,3,5,7,9 or even like 2,4,6,8,
depends is odd we must substract 1 to get even, but if even we can divide 2.
it must be analyze possibilities.Fri, 12 Mar 2021 12:01:54 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/Comment by Max Alekseyev for <p>We got cyclic of integers divide by 2 in number 2**n.
Example:</p>
<pre><code> 8192 is even number
4096 is even number 4096 is even number
2048 is even number 2048 is even number 2048 is even number
1024 is even number 1024 is even number 1024 is even number 1024 is even number
512 is even number 512 is even number 512 is even number 512 is even number
256 is even number 256 is even number 256 is even number 256 is even number
128 is even number 128 is even number 128 is even number 128 is even number
64 is even number 64 is even number 64 is even number 64 is even number
32 is even number 32 is even number 32 is even number 32 is even number
16 is even number 16 is even number 16 is even number 16 is even number
8 is even number 8 is even number 8 is even number 8 is even number
4 is even number 4 is even number 4 is even number 4 is even
2 is even number 2 is even number 2 is even number 2 is even number
1 is odd number 1 is odd number 1 is odd number 1 is odd number
</code></pre>
<p>second example number:</p>
<pre><code>**8186 is even number 40930 is even number
4093 is odd number 20465 is odd number
4092 is even number 20464 is even number
2046 is even number 10232 is even number
1023 is odd number 5116 is even number
1022 is even number 2558 is even number
511 is odd number 1279 is odd number
510 is even number 1278 is even number
255 is odd number 639 is odd number
254 is even number 638 is even number
127 is odd number 319 is odd number
126 is even number 318 is even number
63 is odd number 159 is odd number
62 is even number 158 is even number
31 is odd number 79 is odd number
30 is even number 78 is even number
15 is odd number 39 is odd number
14 is even number 38 is even number
7 is odd number 19 is odd number
6 is even number 18 is even number
3 is odd number 9 is odd number
2 is even number 8 is even number**
1 is odd number 4 is even number
2 is even number
1 is odd number
</code></pre>
<p>how to analyze ciclic of divide number ? or how many ciclic are ?I mean I wuold like to perfom algorithm which will be detect probality divide number without knowing the number. it is cripto task. <br>
for example we know that Point(X,Y) can be odd like 1,3,5,7,9 or even like 2,4,6,8,
depends is odd we must substract 1 to get even, but if even we can divide 2.
it must be analyze possibilities.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56145#post-id-56145I also have trouble understanding your question. What is given and what you need to compute?Fri, 12 Mar 2021 17:45:58 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56145#post-id-56145Comment by Miroslaw for <p>We got cyclic of integers divide by 2 in number 2**n.
Example:</p>
<pre><code> 8192 is even number
4096 is even number 4096 is even number
2048 is even number 2048 is even number 2048 is even number
1024 is even number 1024 is even number 1024 is even number 1024 is even number
512 is even number 512 is even number 512 is even number 512 is even number
256 is even number 256 is even number 256 is even number 256 is even number
128 is even number 128 is even number 128 is even number 128 is even number
64 is even number 64 is even number 64 is even number 64 is even number
32 is even number 32 is even number 32 is even number 32 is even number
16 is even number 16 is even number 16 is even number 16 is even number
8 is even number 8 is even number 8 is even number 8 is even number
4 is even number 4 is even number 4 is even number 4 is even
2 is even number 2 is even number 2 is even number 2 is even number
1 is odd number 1 is odd number 1 is odd number 1 is odd number
</code></pre>
<p>second example number:</p>
<pre><code>**8186 is even number 40930 is even number
4093 is odd number 20465 is odd number
4092 is even number 20464 is even number
2046 is even number 10232 is even number
1023 is odd number 5116 is even number
1022 is even number 2558 is even number
511 is odd number 1279 is odd number
510 is even number 1278 is even number
255 is odd number 639 is odd number
254 is even number 638 is even number
127 is odd number 319 is odd number
126 is even number 318 is even number
63 is odd number 159 is odd number
62 is even number 158 is even number
31 is odd number 79 is odd number
30 is even number 78 is even number
15 is odd number 39 is odd number
14 is even number 38 is even number
7 is odd number 19 is odd number
6 is even number 18 is even number
3 is odd number 9 is odd number
2 is even number 8 is even number**
1 is odd number 4 is even number
2 is even number
1 is odd number
</code></pre>
<p>how to analyze ciclic of divide number ? or how many ciclic are ?I mean I wuold like to perfom algorithm which will be detect probality divide number without knowing the number. it is cripto task. <br>
for example we know that Point(X,Y) can be odd like 1,3,5,7,9 or even like 2,4,6,8,
depends is odd we must substract 1 to get even, but if even we can divide 2.
it must be analyze possibilities.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56139#post-id-56139i'm looking the answer for question how many sequences with low numbers are included in big numbers. example how similiar is divide numbers from `2**128` regarding to numbers from `2**32 or 2**16.` how to mapping possibilities?
second example :
2**200 = 1606938044258990275541962092341162602522202993782792835301376L
2**100 = 1267650600228229401496703205376L
2**200 divide by 2**100 = 1267650600228229401496703205376L
is that means that beetween 2**200 and 2**100 we have the same divide algorithms for numbers? because 2**100 is included in 2**200 exactly 2**100 times?Fri, 12 Mar 2021 14:29:13 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56139#post-id-56139Comment by tmonteil for <p>We got cyclic of integers divide by 2 in number 2**n.
Example:</p>
<pre><code> 8192 is even number
4096 is even number 4096 is even number
2048 is even number 2048 is even number 2048 is even number
1024 is even number 1024 is even number 1024 is even number 1024 is even number
512 is even number 512 is even number 512 is even number 512 is even number
256 is even number 256 is even number 256 is even number 256 is even number
128 is even number 128 is even number 128 is even number 128 is even number
64 is even number 64 is even number 64 is even number 64 is even number
32 is even number 32 is even number 32 is even number 32 is even number
16 is even number 16 is even number 16 is even number 16 is even number
8 is even number 8 is even number 8 is even number 8 is even number
4 is even number 4 is even number 4 is even number 4 is even
2 is even number 2 is even number 2 is even number 2 is even number
1 is odd number 1 is odd number 1 is odd number 1 is odd number
</code></pre>
<p>second example number:</p>
<pre><code>**8186 is even number 40930 is even number
4093 is odd number 20465 is odd number
4092 is even number 20464 is even number
2046 is even number 10232 is even number
1023 is odd number 5116 is even number
1022 is even number 2558 is even number
511 is odd number 1279 is odd number
510 is even number 1278 is even number
255 is odd number 639 is odd number
254 is even number 638 is even number
127 is odd number 319 is odd number
126 is even number 318 is even number
63 is odd number 159 is odd number
62 is even number 158 is even number
31 is odd number 79 is odd number
30 is even number 78 is even number
15 is odd number 39 is odd number
14 is even number 38 is even number
7 is odd number 19 is odd number
6 is even number 18 is even number
3 is odd number 9 is odd number
2 is even number 8 is even number**
1 is odd number 4 is even number
2 is even number
1 is odd number
</code></pre>
<p>how to analyze ciclic of divide number ? or how many ciclic are ?I mean I wuold like to perfom algorithm which will be detect probality divide number without knowing the number. it is cripto task. <br>
for example we know that Point(X,Y) can be odd like 1,3,5,7,9 or even like 2,4,6,8,
depends is odd we must substract 1 to get even, but if even we can divide 2.
it must be analyze possibilities.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56137#post-id-56137Your question is too vague. What probability are you using on the set of integers ?Fri, 12 Mar 2021 13:51:39 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56137#post-id-56137Comment by Miroslaw for <p>We got cyclic of integers divide by 2 in number 2**n.
Example:</p>
<pre><code> 8192 is even number
4096 is even number 4096 is even number
2048 is even number 2048 is even number 2048 is even number
1024 is even number 1024 is even number 1024 is even number 1024 is even number
512 is even number 512 is even number 512 is even number 512 is even number
256 is even number 256 is even number 256 is even number 256 is even number
128 is even number 128 is even number 128 is even number 128 is even number
64 is even number 64 is even number 64 is even number 64 is even number
32 is even number 32 is even number 32 is even number 32 is even number
16 is even number 16 is even number 16 is even number 16 is even number
8 is even number 8 is even number 8 is even number 8 is even number
4 is even number 4 is even number 4 is even number 4 is even
2 is even number 2 is even number 2 is even number 2 is even number
1 is odd number 1 is odd number 1 is odd number 1 is odd number
</code></pre>
<p>second example number:</p>
<pre><code>**8186 is even number 40930 is even number
4093 is odd number 20465 is odd number
4092 is even number 20464 is even number
2046 is even number 10232 is even number
1023 is odd number 5116 is even number
1022 is even number 2558 is even number
511 is odd number 1279 is odd number
510 is even number 1278 is even number
255 is odd number 639 is odd number
254 is even number 638 is even number
127 is odd number 319 is odd number
126 is even number 318 is even number
63 is odd number 159 is odd number
62 is even number 158 is even number
31 is odd number 79 is odd number
30 is even number 78 is even number
15 is odd number 39 is odd number
14 is even number 38 is even number
7 is odd number 19 is odd number
6 is even number 18 is even number
3 is odd number 9 is odd number
2 is even number 8 is even number**
1 is odd number 4 is even number
2 is even number
1 is odd number
</code></pre>
<p>how to analyze ciclic of divide number ? or how many ciclic are ?I mean I wuold like to perfom algorithm which will be detect probality divide number without knowing the number. it is cripto task. <br>
for example we know that Point(X,Y) can be odd like 1,3,5,7,9 or even like 2,4,6,8,
depends is odd we must substract 1 to get even, but if even we can divide 2.
it must be analyze possibilities.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56132#post-id-56132yes. and I'm stuckFri, 12 Mar 2021 12:35:39 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56132#post-id-56132Comment by tmonteil for <p>We got cyclic of integers divide by 2 in number 2**n.
Example:</p>
<pre><code> 8192 is even number
4096 is even number 4096 is even number
2048 is even number 2048 is even number 2048 is even number
1024 is even number 1024 is even number 1024 is even number 1024 is even number
512 is even number 512 is even number 512 is even number 512 is even number
256 is even number 256 is even number 256 is even number 256 is even number
128 is even number 128 is even number 128 is even number 128 is even number
64 is even number 64 is even number 64 is even number 64 is even number
32 is even number 32 is even number 32 is even number 32 is even number
16 is even number 16 is even number 16 is even number 16 is even number
8 is even number 8 is even number 8 is even number 8 is even number
4 is even number 4 is even number 4 is even number 4 is even
2 is even number 2 is even number 2 is even number 2 is even number
1 is odd number 1 is odd number 1 is odd number 1 is odd number
</code></pre>
<p>second example number:</p>
<pre><code>**8186 is even number 40930 is even number
4093 is odd number 20465 is odd number
4092 is even number 20464 is even number
2046 is even number 10232 is even number
1023 is odd number 5116 is even number
1022 is even number 2558 is even number
511 is odd number 1279 is odd number
510 is even number 1278 is even number
255 is odd number 639 is odd number
254 is even number 638 is even number
127 is odd number 319 is odd number
126 is even number 318 is even number
63 is odd number 159 is odd number
62 is even number 158 is even number
31 is odd number 79 is odd number
30 is even number 78 is even number
15 is odd number 39 is odd number
14 is even number 38 is even number
7 is odd number 19 is odd number
6 is even number 18 is even number
3 is odd number 9 is odd number
2 is even number 8 is even number**
1 is odd number 4 is even number
2 is even number
1 is odd number
</code></pre>
<p>how to analyze ciclic of divide number ? or how many ciclic are ?I mean I wuold like to perfom algorithm which will be detect probality divide number without knowing the number. it is cripto task. <br>
for example we know that Point(X,Y) can be odd like 1,3,5,7,9 or even like 2,4,6,8,
depends is odd we must substract 1 to get even, but if even we can divide 2.
it must be analyze possibilities.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56131#post-id-56131It is homework ?Fri, 12 Mar 2021 12:25:29 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56131#post-id-56131Answer by tmonteil for <p>We got cyclic of integers divide by 2 in number 2**n.
Example:</p>
<pre><code> 8192 is even number
4096 is even number 4096 is even number
2048 is even number 2048 is even number 2048 is even number
1024 is even number 1024 is even number 1024 is even number 1024 is even number
512 is even number 512 is even number 512 is even number 512 is even number
256 is even number 256 is even number 256 is even number 256 is even number
128 is even number 128 is even number 128 is even number 128 is even number
64 is even number 64 is even number 64 is even number 64 is even number
32 is even number 32 is even number 32 is even number 32 is even number
16 is even number 16 is even number 16 is even number 16 is even number
8 is even number 8 is even number 8 is even number 8 is even number
4 is even number 4 is even number 4 is even number 4 is even
2 is even number 2 is even number 2 is even number 2 is even number
1 is odd number 1 is odd number 1 is odd number 1 is odd number
</code></pre>
<p>second example number:</p>
<pre><code>**8186 is even number 40930 is even number
4093 is odd number 20465 is odd number
4092 is even number 20464 is even number
2046 is even number 10232 is even number
1023 is odd number 5116 is even number
1022 is even number 2558 is even number
511 is odd number 1279 is odd number
510 is even number 1278 is even number
255 is odd number 639 is odd number
254 is even number 638 is even number
127 is odd number 319 is odd number
126 is even number 318 is even number
63 is odd number 159 is odd number
62 is even number 158 is even number
31 is odd number 79 is odd number
30 is even number 78 is even number
15 is odd number 39 is odd number
14 is even number 38 is even number
7 is odd number 19 is odd number
6 is even number 18 is even number
3 is odd number 9 is odd number
2 is even number 8 is even number**
1 is odd number 4 is even number
2 is even number
1 is odd number
</code></pre>
<p>how to analyze ciclic of divide number ? or how many ciclic are ?I mean I wuold like to perfom algorithm which will be detect probality divide number without knowing the number. it is cripto task. <br>
for example we know that Point(X,Y) can be odd like 1,3,5,7,9 or even like 2,4,6,8,
depends is odd we must substract 1 to get even, but if even we can divide 2.
it must be analyze possibilities.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?answer=56133#post-id-56133I am not sure about your precise question. Here is some hint anyway:
If you write your number in base 2, the last digit tells you whether the number is even (it is a "0"), or odd (it is a "1").
Now, if your number is even, dividing by 2 corresponds to removing the last "0".
If your number is odd, removing 1 corresponds to replacing the last "1" by a "0".
Hence, to reach 0 from your initial number n, the number of time you will get an odd number in your procedure is the number of "1" in the binary representation of your number n, and the number of time you will get an even number in your procedure is the length of the binary representation of your number n minus 1 (note that the binary representation of 0 has length 1).
Let us consider your last example:
sage: n = 40930
sage: s = n.str(base=2)
sage: s
'1001111111100010'
sage: s.count('1')
10
sage: len(s) - 1
15
Hence, in your procedure, you will have to remove 10 times a 1, and you will have to divide by 2 15 times to reach the number 0.Fri, 12 Mar 2021 12:35:46 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?answer=56133#post-id-56133Comment by tmonteil for <p>I am not sure about your precise question. Here is some hint anyway:</p>
<p>If you write your number in base 2, the last digit tells you whether the number is even (it is a "0"), or odd (it is a "1").</p>
<p>Now, if your number is even, dividing by 2 corresponds to removing the last "0".</p>
<p>If your number is odd, removing 1 corresponds to replacing the last "1" by a "0".</p>
<p>Hence, to reach 0 from your initial number n, the number of time you will get an odd number in your procedure is the number of "1" in the binary representation of your number n, and the number of time you will get an even number in your procedure is the length of the binary representation of your number n minus 1 (note that the binary representation of 0 has length 1).</p>
<p>Let us consider your last example:</p>
<pre><code>sage: n = 40930
sage: s = n.str(base=2)
sage: s
'1001111111100010'
sage: s.count('1')
10
sage: len(s) - 1
15
</code></pre>
<p>Hence, in your procedure, you will have to remove 10 times a 1, and you will have to divide by 2 15 times to reach the number 0.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56138#post-id-56138You can make arbitrarily long sequences : iy you take `2^100` you will get 100 divisons by 2. Iy you take `2^100-1` you will get 99 divisions by 2 and 99 removal of 1.Fri, 12 Mar 2021 13:53:03 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56138#post-id-56138Comment by Miroslaw for <p>I am not sure about your precise question. Here is some hint anyway:</p>
<p>If you write your number in base 2, the last digit tells you whether the number is even (it is a "0"), or odd (it is a "1").</p>
<p>Now, if your number is even, dividing by 2 corresponds to removing the last "0".</p>
<p>If your number is odd, removing 1 corresponds to replacing the last "1" by a "0".</p>
<p>Hence, to reach 0 from your initial number n, the number of time you will get an odd number in your procedure is the number of "1" in the binary representation of your number n, and the number of time you will get an even number in your procedure is the length of the binary representation of your number n minus 1 (note that the binary representation of 0 has length 1).</p>
<p>Let us consider your last example:</p>
<pre><code>sage: n = 40930
sage: s = n.str(base=2)
sage: s
'1001111111100010'
sage: s.count('1')
10
sage: len(s) - 1
15
</code></pre>
<p>Hence, in your procedure, you will have to remove 10 times a 1, and you will have to divide by 2 15 times to reach the number 0.</p>
https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56134#post-id-56134Yes that correct, but only when we know the "n", algorithm must work without "n" becouse we know only (X,Y) of "n" where "n" is a integer, algorithm must analyze possibilites that "n" is even or ord and trying to perform calculate. I need to find maximum ciclic of divides. i dont know how to better explain. this must be example everse of creating Point(X,Y) on the curve. too dificult , and i ask for helpFri, 12 Mar 2021 12:44:03 +0100https://ask.sagemath.org/question/56130/numbers-in-numbers-divide-by-2-cyclic-algorithm-compare/?comment=56134#post-id-56134