Răspuns :
n= aaa-abb+3(b-a)
n=111•a-(100a+11b)+3b-3a
n=111•a-100a-11b+3b-3a
n=8a-8b
8(a-b)= patrat perfect
4•2(a-b)= patrat perfect=> 2(a-b)= patrat perfect
=> (a-b)∈{2; 8}
pentru a-b=2; a si b nenule:
(a;b) ∈{(3; 1); (4; 2); (5; 3); (6; 4); (7; 5); (8; 6); (9; 7)}
333-311+3(1-3)=22+3-9=16=4²
444-422+3(1-3)=22+3-9=16=4²
555-533+3(1-3)=22+3-9=16=4²
…………………………………………
999-977+3(1-3)=22+3-9=16=4²
pentru a-b=8; a si b nenule:
(a;b) ∈{(9; 1)}
999-911+3(1-9)=88+3-27=64=8²