mersenneforum.org Endomorphisms and Factoring
 Register FAQ Search Today's Posts Mark Forums Read

2017-06-29, 01:48   #12
CRGreathouse

Aug 2006

3·1,993 Posts

Quote:
 Originally Posted by manasi 1. I need to find out a program that only deals in machine level 0s and 1s. What I mean is unlike C++, Java, etc...decimals are not converted to binary but it is a program where every number dealing is binary.
In almost every modern language, certainly including PARI/GP, C++, and Java, all numbers are in binary unless you go through a lot of extra effort to avoid that (via BCD or other formats). You enter numbers in decimal, but they are stored and processed exclusively in binary and only re-converted into decimal when you output them.

Quote:
 Originally Posted by manasi There should be no fixed integer range so large blocks can be dealt with in a good way.
This only slightly less common. Some languages like PARI/GP and Python have bignums built-in so you can't reasonably overflow, and many others like C and Java have libraries that can support them as needed.

2017-06-29, 10:11   #13
manasi

Jun 2017

13 Posts

Quote:
 Originally Posted by paulunderwood If you have linux you could use the bc language: Code: bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type warranty'. ibase=2 obase=2 101010*101001 11010111010` I think you can get it for Windows and iPhone
Thanks

2017-06-29, 10:13   #14
manasi

Jun 2017

13 Posts

Quote:
 Originally Posted by Dubslow Do you mean something like GMP? Yes, every language still fundamentally works in binary, but typically in fixed-width binary. GMP is a library for C (and therefore all its derivatives) that allows for arbitrary-size integers. It's very common in big number prime testing and factorization code. https://en.wikipedia.org/wiki/List_o...metic_software A lot of the languages and software packages in the above list use GMP under the hood.
Thanks. I learnt about GMP. I was talking about ASCII specifications and space a signed or unsigned int occupies. I will explain in next post.

Last fiddled with by manasi on 2017-06-29 at 10:14

 2017-06-29, 10:19 #15 ET_ Banned     "Luigi" Aug 2002 Team Italia 483710 Posts I am probably wrong on this, but... Isn't the use of fixed length variables a matter of the machine word length, i.e. hardware stuff, not software stuff? In other words, the use of decimal, binary, hexadecimal or whatever else is bound to the physical representation of the bits inside the computer registers. This means that a "binary, unbound bit-length language" is something as theoretical as a Turing Machine...
2017-06-29, 10:23   #16
manasi

Jun 2017

11012 Posts

Quote:
 Originally Posted by CRGreathouse In almost every modern language, certainly including PARI/GP, C++, and Java, all numbers are in binary unless you go through a lot of extra effort to avoid that (via BCD or other formats). You enter numbers in decimal, but they are stored and processed exclusively in binary and only re-converted into decimal when you output them.
Well, the only problem is there is a certain integer range that is acceptable as space for an integer(signed or unsigned int). There is a problem if you have to check a number like 2^10000019 -1 is prime or not. Most programs can not handle operations with large numbers.

Now, suppose I do not want to use Lucas Lehmer test but instead want to create endomorphisms that directly alter blocks of the binary sequence 2^10000019 -1 yielding a result with less operations. For instance, you could rule out division from {multiplication,division,subtraction} but only use {subtraction,multiplication}. There would be very large binary sequences. This is what I want to do to get results a different way.

Quote:
 Originally Posted by CRGreathouse This only slightly less common. Some languages like PARI/GP and Python have bignums built-in so you can't reasonably overflow, and many others like C and Java have libraries that can support them as needed.
Oh!

Last fiddled with by CRGreathouse on 2017-06-29 at 14:46 Reason: fix quote tag

2017-06-29, 10:51   #17
ET_
Banned

"Luigi"
Aug 2002
Team Italia

7·691 Posts

Quote:
 Originally Posted by manasi Now, suppose I do not want to use Lucas Lehmer test but instead want to create endomorphisms that directly alter blocks of the binary sequence 2^10000019 -1 yielding a result with less operations. For instance, you could rule out division from {multiplication,division,subtraction} but only use {subtraction,multiplication}. There would be very large binary sequences. This is what I want to do to get results a different way. Oh!
Montgomery multiplication and binary exponentiation?

2017-06-29, 14:45   #18
CRGreathouse

Aug 2006

3×1,993 Posts

Quote:
 Originally Posted by manasi Now, suppose I do not want to use Lucas Lehmer test but instead want to create endomorphisms that directly alter blocks of the binary sequence 2^10000019 -1 yielding a result with less operations.
I don't know why you think it is possible to go faster than LL by working "directly"with binary. All existing programs work directly with binary.

Last fiddled with by CRGreathouse on 2017-06-29 at 14:46

2017-06-29, 16:32   #19
Batalov

"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

3·7·461 Posts

Quote:
 Originally Posted by manasi Most programs can not handle operations with large numbers.
Depends on what you call 'most'. Excel? calc.exe?

Quote:
 Originally Posted by manasi ... This is what I want to do to get results a different way. ... Oh!
In order to get results a different way you first need to read and learn what is already done.

Two Russian anecdotes come to mind:
1. "Can you play violin?" -- "I never tried but I think I can!". This was popular [I]long[/I] before the Kruger & Dunning 1999 paper.
2. "Can you play (using a)* violin?" -- "I can! ...But it is very inconvenient - the cards** slip and fall over. Cello is much better."
______________
*In Russian, "to play violin" is a phrase with a preposition.
**And of course "play" in most minds means "play cards"

2017-06-29, 18:34   #20
manasi

Jun 2017

1310 Posts

Quote:
 Originally Posted by ET_ Montgomery multiplication and binary exponentiation?
I thought to use endomorphisms and work similar to modular arithmetic -

Start to compare size of two binary numbers minus zeroes at the end. Then just play with the blocks using endomorphisms. Different algorithm other than the two you mentioned. But then, as you say, perhaps machine specifies integer width.(hardware) So, I can not proceed on this line.

2017-06-29, 18:36   #21
manasi

Jun 2017

11012 Posts

Quote:
 Originally Posted by CRGreathouse I don't know why you think it is possible to go faster than LL
No idea if I can go faster. Didn't exactly write and compare the two algorithms. Just wanted to try different.

2017-06-29, 18:38   #22
manasi

Jun 2017

1310 Posts

Quote:
 Originally Posted by Batalov In order to get results a different way you first need to read and learn what is already done.
Thanks.
Very true.(i) I would like to know more about endomorphisms acting on binary sequences. (ii) Are they more/less helpful in factoring? I googled but did not get suitable results.

Last fiddled with by manasi on 2017-06-29 at 18:39

All times are UTC. The time now is 10:55.

Sun Jan 16 10:55:02 UTC 2022 up 177 days, 5:24, 0 users, load averages: 0.96, 0.72, 0.76