Walking positive square numbers and closing or opening doors

55 Views Asked by At

Peter moves in a hallway with $N+1$ doors consecutively numbered from $0$ through $N$. All doors are initially closed. Peter starts in front of door $0$, and repeatedly performs the following steps:

First, he walks a positive square number of doors away from his position.

Then he walks another, larger square number of doors away from his new position.

He toggles the door he faces (opens it if closed, closes it if open).

And finally returns to door $0$.

We call an action any sequence of those steps. Peter never performs the exact same action twice, and makes sure to perform all possible actions that don't bring him past the last door.

Let $F(N)$ be the number of doors that are open after Peter has performed all possible actions. You are given that $F(5) = 1$, $F(100) = 27$, $F(1000) = 233$ and $F(10^6) = 112168$.

Find $F(10^{12})$.

I was presented this question and the only idea of solution discussed was programming, so I wanted to know if there is some other way to solve it.

1

There are 1 best solutions below

0
On

most recent I've noticed on MSE Meta: http://meta.math.stackexchange.com/questions/21383/project-euler-again September 2015

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Magazine article by James Sommers :

http://www.theatlantic.com/technology/archive/2011/06/how-i-failed-failed-and-finally-succeeded-at-learning-how-to-code/239855/

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

discussion on MO:

http://tea.mathoverflow.net/discussion/1226/project-euler-questions/

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

discussion at Project Euler's own forum:

http://projecteuler.chat/viewtopic.php?f=5&t=2707

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

email letter from "hk", Novemeber 2011

Hi Will,

let me introduce myself to you. I'm hk at Project Euler. The philosophy of Colin Hughes, the founder of Project Euler was the philosophy of inductive self learning. Just Googling on the subject will reveal you quite a lot about this educational subject. (The top item on my version of Google was this one: http://mate.calpoly.edu/media/files/Review_inductive_learning.pdf)

My personal view on this matter is: if you lack the attitude, when faced with a new problem, to break it down into smaller parts or to investigate smaller cases you will never never become a successful scientist or academically schooled person. The problem in question that raised attention to Project Euler is particularly fit for scaling down and discover some useful facts.

I think we are facing a cultural clash here: The rationalisations shown to us by e.g. rbharvs are from the level: I have to be told how to do things. I'm afraid that has to do with a failing educational system that shows students rules and formulas without giving them enough room to experiment before formalising knowledge.

To do some work that is new to you, be it research mathematics or toying around with problems for which all underlying maths is known, you will need to doodle around with the problem or parts of it. How else can one do essentially new work? Top down teaching that doesn't help their students to develop this kind of ability produces people that start shouting: tell me how to do it and I will try to copy it. Some people that are badly educated in the way I sketched are just using Project Euler to develop those skills. I hope that they will benefit from that in their professional life. Some have even indicated that it was Project Euler that ultimately made them decide to choose mathematics for their academic study despite the poor level of the mathematical education in their country.

The people that posed the questions at Math Overflow, in my opinion have shown to lack the mental attitude to do the necessary doodling around. (Take for instance the fact that one of them copied the radius 10^10. Some experimenting would have shown them that ______).

Well, you can consider this private communication as lunch talk if it doesn't interest you, but I hope I gave you some information about the philosophy of Project Euler. Feel free to paraphrase it to your wish when communicating with your colleagues at Math Overflow. If you like to know more feel free to email me.

Thanks again for the effort you have invested in the case.

Regards

hk

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=