Posts Tagged with "Repunit"

Project Euler 133: Repunit nonfactors

Saturday, January 26, 2013


Problem 133 of Project Euler is a continuation of Problem 132 and Problem 129 in which we are supposed to find the some prime numbers which are not factors of R(10n) for any n. In fact the problem readsFind the sum of all the primes below one-hundred thousand that will never be a factor of R(10n).I have found two methods for solving this. Both build upon the same principle which I will present first...

Continue reading...

Project Euler 132: Large repunit factors

Saturday, January 19, 2013


In problem 132 of Project Euler we are going back to working with repunits in a problem that readsFind the sum of the first forty prime factors of the repuint R(109).This is a pretty large number, and having to actually do trial division would be a pain and take quite a while, even though we have BigInteger class which is certainly a help here.

Continue reading...

Project Euler 130: Finding composite values, n, for which n−1 is divisible by the length of the smallest repunits that divide it.

Saturday, January 5, 2013


Problem 130 of Project Euler is a continuation of problem 129, so if you have already solved that this one should be pretty easy. It readsFind the sum of the first twenty-five composite values of n for which GCD(n, 10) = 1 and n - 1 is divisible by A(n).If you have already solved Problem 129 as we have, this one can be solved pretty easily. We already have a function that will give us A(n), so we can just brute force our way through the problem calculating check if n-1 is divisible by A(n) and n is not a prime.

Continue reading...

Project Euler 129: Investigating minimal repunits that divide by n.

Saturday, December 29, 2012


Problem 129 of Project Euler readsA number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111.Given that n is a positive integer and GCD(n, 10) = 1, it can be shown that there always exists a value, k, for which R(k) is divisible byn, and let A(n) be the least such value of kFind the least value of n for which A(n) first exceeds one-million.This problem can be solved by applying the principles of long division so we avoid having to multiply extremely large numbers

Continue reading...
This site uses cookies.