A156993 a(n) = the least positive k such that n^2 and (n+k)^2 have no common digits, or 0 if no such k exists.
1, 1, 1, 1, 1, 1, 1, 2, 1, 6, 5, 9, 3, 2, 1, 4, 4, 2, 6, 1, 3, 2, 1, 3, 5, 3, 3, 2, 2, 1, 4, 14, 31, 25, 13, 23, 26, 8, 7, 19, 17, 4, 3, 2, 1, 11, 16, 9, 28, 14, 6, 11, 4, 3, 8, 12, 9, 19, 19, 16, 5, 3, 13, 2, 21, 18, 23, 8, 22, 4, 5, 12, 14, 5, 16, 13, 14, 1, 7, 118, 5, 7, 8, 2, 7, 5, 4, 3, 2, 3, 66
Offset: 0
Examples
a(0)=1 because squares 0^2=0 and (0+1)^2=1 have no common digits, a(9)=6 because squares 9^2=81 and (9+6)^2=225 have no common digits.
Crossrefs
Cf. A068802
Programs
-
Mathematica
lpk[n_]:=Module[{k=1},While[ContainsAny[IntegerDigits[n^2], IntegerDigits[ (n+k)^2]], k++];k]Array[lpk,100,0] (* Harvey P. Dale, Jun 17 2016 *)
Comments