OFFSET
0,2
LINKS
Paolo P. Lava, Table of n, a(n) for n = 0..10000
EXAMPLE
a(1) = 12 because (12 - 1)^2 = 11^2 = 121 contains 12 as a substring and it is the least number with this property.
MAPLE
with(numtheory): P:= proc(q) local a, b, d, j, k, n, ok;
for n from 0 to q do for k from 1 to q do a:=ilog10(k)+1; b:=(n-k)^2; d:=ilog10((k-n)^2)-ilog10(k)+1;
ok:=0; for j from 1 to d do if k=(b mod 10^a) then ok:=1; break; else b:=trunc(b/10); fi; od;
if ok=1 then print(k); break; fi; od; od; end: P(10^6);
MATHEMATICA
nk[n_]:=Module[{k=1}, While[SequenceCount[IntegerDigits[(k-n)^2], IntegerDigits[ k]]==0, k++]; k]; Array[lnk, 90, 0] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 13 2021 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Jan 31 2017
EXTENSIONS
Typo in definition corrected by Harvey P. Dale, Feb 27 2017.
Entries, Maple code and b-file corrected at the suggestion of Harvey P. Dale, Feb 28 2017.
STATUS
approved
