login
A137064
Numbers k such that k and k^2 use only the digits 1, 6, 7 and 8.
0
1, 881, 88776, 7866881
OFFSET
1,2
COMMENTS
Generated with DrScheme.
No additional terms through 10^10. - Harvey P. Dale, Apr 26 2015
No additional terms through 10^27. - Robert Israel, Nov 23 2023
LINKS
EXAMPLE
7866881^2 = 61887816668161.
MAPLE
Good:= {1, 6, 7, 8}:
G[1]:= {1, 6}: R:= 1;
for d from 2 to 27 do
G[d]:= select(t -> member(floor((t^2 mod 10^d)/10^(d-1)), Good), map(t -> seq(10^(d-1)*i+t, i=Good), G[d-1]));
for t in G[d] do
if convert(convert(t^2, base, 10), set) subset Good then R:= R, t fi
od
od:
sort([R]); # Robert Israel, Nov 23 2023
MATHEMATICA
With[{c={1, 6, 7, 8}}, Select[Flatten[Table[FromDigits/@Tuples[c, n], {n, 7}]], SubsetQ[c, IntegerDigits[#^2]]&]] (* Harvey P. Dale, Apr 26 2015 *)
CROSSREFS
Sequence in context: A105976 A340342 A265181 * A092675 A135127 A338538
KEYWORD
base,nonn,more
AUTHOR
Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008
STATUS
approved