Page 1 of 1

Problem 612

Posted: Sun Oct 22, 2017 4:17 pm
by Ytsejam
Is it possible to get a few more examples (say f(1000) or f(10000)?)

I thought I'd gotten it and brute force counting seems to give the same results as my solution for smaller power of 10 (before it becomes unfeasible to do brute force in reasonable time) *but* I can't understand why f(10**18) seems to be wrong.

Re: Problem 612

Posted: Sun Oct 22, 2017 4:26 pm
by MuthuVeerappanR
I too thought the number of test values given (that is 1) is very low..

I think the Dev team can come up with some sort of criteria for test values too... One that can be verified by brute force, one that is not, one that can help in eliminating tricking cases and things like that... Just a suggestion..

Re: Problem 612

Posted: Sun Oct 22, 2017 4:54 pm
by v6ph1
The problem was released less than 16 hours ago.
And the problem description is clear.

You can easily check that f(10) = 0.
The next friend numbers are:
1, 10, 11, 12, ...
2, 12, 20, 21, ...
3, 13, 23, 30, ...

Take care about double counting!

The value for 1000 can be easily checked by brute force all possible pairs.
Each solution for 10^n has exactly 2n digits. (n>1)

@Ytsejam:
Take care about overflows.
The result for 10^10 exceeds the 64bit limit. (10^5 for 32bit)