Problem

Source: Czech-Polish-Slovak Junior Match 2015, Team p4 CPSJ

Tags: LCM, GCD, number theory



Determine all such pairs pf positive integers $(a, b)$ such that $a + b + (gcd (a, b))^ 2 = lcm (a, b) = 2 \cdot lcm(a -1, b)$, where $lcm (a, b)$ denotes the smallest common multiple, and $gcd (a, b)$ denotes the greatest common divisor of numbers $a, b$.