P612
projecteuler.net

Friend Numbers

ℹ️Published on Sunday, 22nd October 2017, 01:00 am; Solved by 759;
Difficulty rating: 30%

Let's call two numbers friend numbers if their representation in base $10$ has at least one common digit.
E.g. $1123$ and $3981$ are friend numbers.

Let $f(n)$ be the number of pairs $(p,q)$ with $1\le p \lt q \lt n$ such that $p$ and $q$ are friend numbers.
$f(100)=1539$.

Find $f(10^{18}) \bmod 1000267129$.



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.