A387071 a(n) is the least k such that A387070(k) = n. If no such k exists, a(n) = -1.
0, 276, 5, 6, 2, 76, 25, 26, 261, 3, 2985, 642, 3606, 462, 320, 3694, 4, 3205, 2045, 643, 493, 96, 15, 106, 318, 16, 510, 963, 1091, 503, 452, 2705, 550, 482, 1520, 1169, 19, 1462, 4512, 1428, 97, 2639, 675, 2055, 12, 216, 119, 6525, 2135, 7, 726, 246, 674, 2146, 710, 816, 74, 1026, 7401, 23, 255, 2490, 75, 2510, 8, 4782, 1125, 1923
Offset: 0
Examples
276 is the smallest number such that, when all of its digits are removed from the decimal representation of its square, 76176, the result is 1. Therefore, a(1) = 276.
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..12462 (terms 0..10000 from Andrew Howroyd)
Crossrefs
Cf. A387070.
Programs
-
Mathematica
f[k_] := FromDigits[Select[IntegerDigits[k^2], FreeQ[IntegerDigits[k], #] &]]; seq[max_] := Module[{v = Array[f, max, 0], s = {}, k = 0, i}, While[NumberQ[(i = FirstPosition[v, k][[1]])], AppendTo[s, i - 1]; k++]; s]; seq[10000] (* Amiram Eldar, Aug 16 2025 *)
-
PARI
\\ here b(n) is A387070(n). b(n)={my(S=Set(digits(n))); fromdigits(select(x->!setsearch(S,x), digits(n^2)))} a(n)={for(k=0, oo, if(b(k)==n, return(k)))} \\ Andrew Howroyd, Aug 15 2025
-
Python
# uses code in A387070 from itertools import count, product def A387071(n): if n == 0: return 0 s = sorted(set("0123456789") - set(str(n))) if s == [] or s == ["0"]: return -1 return next(k for d in count(1) for t in product(s, repeat=d) if A387070(k:=int("".join(t)))==n) print([A387071(n) for n in range(68)]) # Michael S. Branicky, Aug 16 2025
Comments