Problem 097
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
Phibonacci
- Posts: 10
- Joined: Fri Nov 28, 2008 4:04 am
- Location: Des Moines, IA
- Contact:
Problem 097
Is the number like this:
28433×(27830457+1)
or:
(28433×27830457)+1
28433×(27830457+1)
or:
(28433×27830457)+1
Phibonacci - A juxtaposition of Phi (The Golden Ratio) and Fibonacci (Leonardo of Pisa)
- Tommy137
- Posts: 238
- Joined: Sun Feb 24, 2008 6:02 pm
- Location: Cologne, Germany
- Contact:
Re: Problem 097
Phibonacci wrote:Is the number like this:
28433×(27830457+1)
or:
(28433×27830457)+1
(28433×27830457)+1 is correct.

-
JMW1994
- Posts: 43
- Joined: Sat Apr 09, 2011 11:35 pm
Problem 97
Is 28433×27830457+1 calculated like this (28433×27830457)+1 or 28433×(27830457+1)? It appears that either way, I can't get to the correct answer. The fastest way is to only focus on the last 10-20 digits rather than the 2,000,000+ number as a whole.

-
TripleM
- Posts: 384
- Joined: Fri Sep 12, 2008 3:31 am
-
JMW1994
- Posts: 43
- Joined: Sat Apr 09, 2011 11:35 pm
Re: Problem 97
<snip>
Is it possible to even calculate +2,000,000 digits with an array or linked list?
Is it possible to even calculate +2,000,000 digits with an array or linked list?
Last edited by JMW1994 on Sun Nov 13, 2011 2:47 am, edited 1 time in total.

- elendiastarman
- Posts: 410
- Joined: Sat Dec 22, 2007 8:15 pm
Re: Problem 97
JMW1994, one would think that having been on this forum for several months and posting 28 other times, you should know not to post any results or code, whole or fragmented. In addition, you should also know that this is a public forum. Hence, can you remove your results?
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

-
JMW1994
- Posts: 43
- Joined: Sat Apr 09, 2011 11:35 pm
Re: Problem 97
Okay, they weren't right though. However, can one actually calculate a +2,000,000 digit through an array or linked list?

-
mynameisalreadytaken
- Posts: 20
- Joined: Sun Sep 25, 2011 11:20 pm
Re: Problem 97
It's surely possible - with an arbitrary precision library you could calculate all digits of the number. But this is absolutely not necessary.

-
JMW1994
- Posts: 43
- Joined: Sat Apr 09, 2011 11:35 pm
Re: Problem 97
I already knew that as I already programmed an arbitrary precision library(I call it "system" instead) but maybe it was how the order of 28433×27830457+1 went.mynameisalreadytaken wrote:It's surely possible - with an arbitrary precision library you could calculate all digits of the number. But this is absolutely not necessary.
EDIT: Solved it. Had to do with something in the library that I wrote up.

-
marvin
- Posts: 3
- Joined: Sat Jan 05, 2013 11:59 am
Re: Problem 097
Hi,
I have a BigInt class in C#, but it calculates powers up to ~5000.
So I decided (for this question) to treat every number >10^10 as its last 10 digits, and multiply that (max. 10 digit) number by 2 to get the next power.
is this approach true? I mean I think it would be true , but in the end, I got the last 10 digits and multiply that number by 28433 and added 1. But the answer is not correct.
So what's wrong with this solution?
I have a BigInt class in C#, but it calculates powers up to ~5000.
So I decided (for this question) to treat every number >10^10 as its last 10 digits, and multiply that (max. 10 digit) number by 2 to get the next power.
is this approach true? I mean I think it would be true , but in the end, I got the last 10 digits and multiply that number by 28433 and added 1. But the answer is not correct.
So what's wrong with this solution?
-
thundre
- Posts: 356
- Joined: Sun Mar 27, 2011 10:01 am
Re: Problem 097
Does the end result have more than 10 digits? If so, you should drop some, because the problem only asks for 10.marvin wrote:So what's wrong with this solution?

-
marvin
- Posts: 3
- Joined: Sat Jan 05, 2013 11:59 am
Re: Problem 097
Yes, I entered the last 10 digits of the result.thundre wrote:Does the end result have more than 10 digits? If so, you should drop some, because the problem only asks for 10.marvin wrote:So what's wrong with this solution?
Apparently something wrong with my program.
-
marvin
- Posts: 3
- Joined: Sat Jan 05, 2013 11:59 am
Re: Problem 097
Omg,
I gave up that one and tried another solution, which failed again:
I tried to find a pattern, and discovered that the last 2 digits of powers of two repeat themselves in every 20th power.
So I got (28433 % 20) , and the corresponding two digit number, multiplied that with 220, multiplied by 28433, added 1, and... wrong!
somebody please give a clue where am I doing wrong?
edit: oops, I understood what's wrong with my second solution. gotta find a bigger-digit pattern.
edit 2 : found the bigger pattern, still wrong.. this question is gonna drive me crazy..
I gave up that one and tried another solution, which failed again:
I tried to find a pattern, and discovered that the last 2 digits of powers of two repeat themselves in every 20th power.
So I got (28433 % 20) , and the corresponding two digit number, multiplied that with 220, multiplied by 28433, added 1, and... wrong!
somebody please give a clue where am I doing wrong?
edit: oops, I understood what's wrong with my second solution. gotta find a bigger-digit pattern.
edit 2 : found the bigger pattern, still wrong.. this question is gonna drive me crazy..
- TheEvil
- Posts: 84
- Joined: Sun Nov 13, 2011 10:38 am
- Location: Szeged, Hungary
Re: Problem 097
If you were asked the last two digit of this number, your answer would almost be good. But you have to calculate
(28433%100) × 27830457%20 + 1
and of course at the end, the last two digit of that number. Anyway the problem is solvable without bigintegers (as all the others I have done yet).
(28433%100) × 27830457%20 + 1
and of course at the end, the last two digit of that number. Anyway the problem is solvable without bigintegers (as all the others I have done yet).

- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Problem 097
marvin
Just make sure you multiply by 2 the correct number of times. Try your algo with a smaller power (such as 4321) and see how it checks with the result you would get with your BigInt class.
Just make sure you multiply by 2 the correct number of times. Try your algo with a smaller power (such as 4321) and see how it checks with the result you would get with your BigInt class.
When you assume something, you risk being wrong half the time.
-
hkapur97
- Posts: 1
- Joined: Thu Jan 10, 2013 12:37 pm
- Location: India
Re: Problem 097
This problem can be done by hand if you're very good with [modular arithmetic](en.wikipedia.org/wiki/Modular_arithmetic)
Never give up.