← Complete problem index

PROJECT EULER · #0612

Friend Numbers

Statement only · SolvedOriginal problem ↗

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 1p<q<n such that p and q are friend numbers.
f(100)=1539.

Find f(1018)mod1000267129.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.