← Complete problem index

PROJECT EULER · #0643

2-Friendly

Statement only · SolvedOriginal problem ↗

Two positive integers a and b are 2-friendly when gcd(a,b)=2t,t>0. For example, 24 and 40 are 2-friendly because gcd(24,40)=8=23 while 24 and 36 are not because gcd(24,36)=12=223 is not a power of 2.

Let f(n) be the number of pairs, (p,q), of positive integers with 1p<qn such that p and q are 2-friendly. You are given f(102)=1031 and f(106)=321418433 modulo 1000000007.

Find f(1011) modulo 1000000007.

Write-up coming later

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