Let $a, b, c$ and $d$ be non-negative integers. Prove that the numbers $2^a7^b$ and $2^c7^d$ give the same remainder when divided by $15$ iff the numbers $3^a5^b$ and $3^c5^d$ give the same remainder when divided by $16$.
Problem
Source: 1999 Estonia National Olympiad Final Round grade 12 p1
Tags: number theory, remainder, power of 2, power of 3