Problem

Source: 2012 China TST Test 3 p4

Tags: logarithms, floor function, function, number theory proposed, number theory



Given an integer $n\ge 4$. $S=\{1,2,\ldots,n\}$. $A,B$ are two subsets of $S$ such that for every pair of $(a,b),a\in A,b\in B, ab+1$ is a perfect square. Prove that \[\min \{|A|,|B|\}\le\log _2n.\]