Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(archive/imo): formalize IMO 1962 problem Q1 #4450

Closed
wants to merge 9 commits into from

Conversation

lacker
Copy link
Collaborator

@lacker lacker commented Oct 5, 2020

The problem statement:

Find the smallest natural number $n$ which has the following properties:
(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits,
the resulting number is four times as large as the original number $n$.

This is a proof that 153846 is the smallest member of the set satisfying these conditions.


@lacker lacker added the awaiting-review The author would like community review of the PR label Oct 5, 2020
@jcommelin
Copy link
Member

Please fix the PR title.

@lacker lacker changed the title IMO 1962 Q1 feat(archive/imo): formalize IMO 1962 problem Q1 Oct 5, 2020
archive/imo/imo1962_q1.lean Outdated Show resolved Hide resolved
archive/imo/imo1962_q1.lean Outdated Show resolved Hide resolved
@jsm28
Copy link
Collaborator

jsm28 commented Oct 6, 2020

without_digits should imply (6 * 10 ^ (nat.digits 10 c).length) % 39 = 24, which should be testable for each number of digits using norm_num, no linarith needed.

@jsm28
Copy link
Collaborator

jsm28 commented Oct 6, 2020

That is, 6 * 10 ^ (nat.digits 10 c).length = 39 * c + 24.

@lacker
Copy link
Collaborator Author

lacker commented Oct 6, 2020

without_digits should imply (6 * 10 ^ (nat.digits 10 c).length) % 39 = 24, which should be testable for each number of digits using norm_num, no linarith needed.

I tried it this way, and it does work, but the solution ends up being more complicated than this is right now. It doesn't shorten the logic for each number of digits - see https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/unexpected.20.22bit0.22.2C.20.22bit1.22.20etc for discussion - and it requires the extra proof of (6 * 10 ^ (nat.digits 10 c).length) % 39 = 24. So I suggest keeping this part as linarith applications.

@fpvandoorn fpvandoorn added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Oct 6, 2020
@jcommelin jcommelin added imo Formalisation of an IMO problem awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Oct 8, 2020
@lacker lacker added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Oct 12, 2020
@bryangingechen
Copy link
Collaborator

@lacker I pushed a few changes. Mostly stylistic, but I also removed solutions_nonempty since it's implicit in imo1962_q1.

If you're happy with my edits, feel free to merge.

bors d+

@bors
Copy link

bors bot commented Oct 13, 2020

✌️ lacker can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@lacker
Copy link
Collaborator Author

lacker commented Oct 13, 2020

bors r+

bors bot pushed a commit that referenced this pull request Oct 13, 2020
The problem statement:

Find the smallest natural number $n$ which has the following properties:
(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits,
the resulting number is four times as large as the original number $n$.

This is a proof that 153846 is the smallest member of the set satisfying these conditions.



Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
@bors
Copy link

bors bot commented Oct 13, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(archive/imo): formalize IMO 1962 problem Q1 [Merged by Bors] - feat(archive/imo): formalize IMO 1962 problem Q1 Oct 13, 2020
@bors bors bot closed this Oct 13, 2020
@bors bors bot deleted the lacker/imo2 branch October 13, 2020 04:39
@YaelDillies YaelDillies removed the awaiting-review The author would like community review of the PR label Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imo Formalisation of an IMO problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants