Can someone factor 2^61-1 for me?

KLin

Lifer
Feb 29, 2000
30,335
653
126
2305843009213690000

maybe 42


EDIT: could be 1152921504606850000
 

cheezmunky

Senior member
Sep 30, 2002
298
0
0
Originally posted by: chuckywang

Then what is it?

according to the ti-89 it is 2305843009213693951 but I thought you might have wanted to expand it into a form with a bunch of products or soemthing
 

her209

No Lifer
Oct 11, 2000
56,336
11
0
2^0 = 1
2^1 = 10
2^2 = 100
2^3 = 1000
...
2^61 = 1000...0 (61 zeros)

(2^61)-1 = 1111...1 (60 ones)

Does that help any?
 

BigPoppa

Golden Member
Oct 9, 1999
1,930
0
0
Originally posted by: her209
2^0 = 1
2^1 = 10
2^2 = 100
2^3 = 1000
...
2^61 = 1000...0 (61 zeros)

(2^61)-1 = 1111...1 (60 ones)

Does that help any?

Ummm:
2^0 does in fact = 1.
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16

and so on. I have no clue what you think you were doing :p
 

RaynorWolfcastle

Diamond Member
Feb 8, 2001
8,968
16
81
2^61-1 is prime according to Maple


edit: Guess I could have refreshed, I thought there was something I was missing when you were looking for factors and Maple was saying that it's prime... It's a Mersenne Prime btw. the kind that Prime95 finds
 

JohnCU

Banned
Dec 9, 2000
16,528
4
0
Originally posted by: BigPoppa
Originally posted by: her209
2^0 = 1
2^1 = 10
2^2 = 100
2^3 = 1000
...
2^61 = 1000...0 (61 zeros)

(2^61)-1 = 1111...1 (60 ones)

Does that help any?

Ummm:
2^0 does in fact = 1.
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16

and so on. I have no clue what you think you were doing :p

he's doing binary.

 

beer

Lifer
Jun 27, 2000
11,169
1
0
Originally posted by: chuckywang
Originally posted by: beer
MATLAB gives me a middle finder :(

Exactly.


I looked into the underlying code to figure out why. I read the comments and they said they chose to error-out if n > 2^32 due to large memory consumption. Thinking I was a badass, I removed the error checking in factor.m and executed the code - the underying reason matlab won't do it is that the function primes.m creates a vector 1:2:p, and that vector op - and for that matter, every vector op in matlab - seems to peg an upper bound at 2^32 elements
 

RaynorWolfcastle

Diamond Member
Feb 8, 2001
8,968
16
81
Originally posted by: beer
Originally posted by: chuckywang
Originally posted by: beer
MATLAB gives me a middle finder :(

Exactly.


I looked into the underlying code to figure out why. I read the comments and they said they chose to error-out if n > 2^32 due to large memory consumption. Thinking I was a badass, I removed the error checking in factor.m and executed the code - the underying reason matlab won't do it is that the function primes.m creates a vector 1:2:p, and that vector op - and for that matter, every vector op in matlab - seems to peg an upper bound at 2^32 elements

probably because integers larger than 32-bits are a mess to deal with on x86 and require you to make a new underlying datatype to get around the fact that there's no longlong datatype.
 

So

Lifer
Jul 2, 2001
25,923
17
81
Originally posted by: beer
Originally posted by: chuckywang
Originally posted by: beer
MATLAB gives me a middle finder :(

Exactly.


I looked into the underlying code to figure out why. I read the comments and they said they chose to error-out if n > 2^32 due to large memory consumption. Thinking I was a badass, I removed the error checking in factor.m and executed the code - the underying reason matlab won't do it is that the function primes.m creates a vector 1:2:p, and that vector op - and for that matter, every vector op in matlab - seems to peg an upper bound at 2^32 elements

Impressive. :thumbsup::thumbsup:
 

beer

Lifer
Jun 27, 2000
11,169
1
0
Originally posted by: RaynorWolfcastle
Originally posted by: beer
Originally posted by: chuckywang
Originally posted by: beer
MATLAB gives me a middle finder :(

Exactly.


I looked into the underlying code to figure out why. I read the comments and they said they chose to error-out if n > 2^32 due to large memory consumption. Thinking I was a badass, I removed the error checking in factor.m and executed the code - the underying reason matlab won't do it is that the function primes.m creates a vector 1:2:p, and that vector op - and for that matter, every vector op in matlab - seems to peg an upper bound at 2^32 elements

probably because integers larger than 32-bits are a mess to deal with on x86 and require you to make a new underlying datatype to get around the fact that there's no longlong datatype.

That is a good point. MATLAB treats every data type as a default double, though. I'm wondering if it does the calculations using a double-precision floating point op? If it does, it explains why it is so slow- the integer functional units on P4s are 2x core clock speed, so mine would be 6 GHz, if I recall - floating point would operate at regular clock speed but I'd imagine the memory bandwidth issue would be the limiting factor, not the core speeds. Trying to factor a number in the range of 2^60 involves a hell of a lot of swapping, and a swap operation can take hundreds of thousands of cycles (~milliseconds) compared to tens of nanoseconds for a floating point op.
 

EpsiIon

Platinum Member
Nov 26, 2000
2,351
1
0
Originally posted by: BigPoppa
Originally posted by: her209
2^0 = 1
2^1 = 10
2^2 = 100
2^3 = 1000
...
2^61 = 1000...0 (61 zeros)

(2^61)-1 = 1111...1 (60 ones)

Does that help any?

Ummm:
2^0 does in fact = 1.
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16

and so on. I have no clue what you think you were doing :p

There are 10 types of people in the world: those who know binary and those who don't.
 

Jassi

Diamond Member
Sep 8, 2004
3,296
0
0
Originally posted by: JohnCU
Originally posted by: BigPoppa
Originally posted by: her209
2^0 = 1
2^1 = 10
2^2 = 100
2^3 = 1000
...
2^61 = 1000...0 (61 zeros)

(2^61)-1 = 1111...1 (60 ones)

Does that help any?

Ummm:
2^0 does in fact = 1.
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16

and so on. I have no clue what you think you were doing :p

he's doing binary.

pwned!