A256708
Numbers n such that the decimal expansions of both n and n^2 have 0 as smallest digit and 8 as largest digit.
Original entry on oeis.org
280, 508, 780, 805, 1028, 1078, 1280, 1308, 1680, 1780, 1805, 1840, 2078, 2608, 2680, 2780, 2800, 2801, 2802, 2805, 2840, 2850, 3280, 3580, 3780, 3805, 3808, 3850, 4048, 4078, 4280, 4780, 4804, 4805, 4880, 5008, 5018, 5028, 5048, 5078, 5080, 5084, 5180, 5280
Offset: 1
Cf.
A136814,
A136820,
A136825,
A136829,
A136832,
A136840,
A136845,
A136849,
A136904,
A256630,
A256631,
A256633,
A256634,
A256709.
-
fQ[n_] := Block[{c = DigitCount@ n}, And[c[[9]] == 0, c[[8]] > 0, c[[10]] > 0]]; Select[Range@ 5280, fQ@ # && fQ[#^2] &] (* Michael De Vlieger, Apr 12 2015 *)
maxdQ[n_]:=Module[{id1=IntegerDigits[n],id2=IntegerDigits[n^2]},Max[ id1] == Max[ id2] == 8&&Min[id1]==Min[id2]==0]; Select[Range[6000],maxdQ] (* Harvey P. Dale, Oct 19 2021 *)
-
is(n) = vecmin(digits(n))==0 && vecmin(digits(n^2))==0 && vecmax(digits(n))==8 && vecmax(digits(n^2))==8
A136809
Numbers k such that k and k^2 use only the digits 0, 1, 2 and 3.
Original entry on oeis.org
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11100, 11101, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111, 101000, 101001, 101010, 101011, 101100, 101110, 110000, 110001, 110010, 110100, 110101, 111000, 111001, 111010
Offset: 1
Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008
111^2 = 12321,
11101^2 = 123232201, and
101011^2 = 10203222121,
111001^2 = 12321222001, so 111, 11101, 101011 and 111001 are in the sequence, but:
110011^2 = 12102420121, so 110011 is not in the sequence; also
1100011^2 = 1210024200121, so 1100011 is not in the sequence, and
1010101^2 = 1020304030201, so 1010101 is not in the sequence; but
1110001^2 = 1232102220001, so 1110001 is in the sequence; also
1010100100001^2 = 1020302212022030200200001.
-
Select[Range[0,200000],And@@(ContainsAll[{0,1,2,3},Union@IntegerDigits@#]&/@{#,#^2})&] (* Giorgos Kalogeropoulos, May 21 2021 *)
With[{c={0,1,2,3}},Select[FromDigits/@Tuples[c,6],SubsetQ[c,IntegerDigits[ #^2]]&]] (* Harvey P. Dale, Jun 01 2021 *)
-
select( {is_A136809(n,o(n)=vecmax(digits(n))<4)=o(n^2)&&o(n)}, [fromdigits(binary(n))|n<-[0..99]]) \\ M. F. Hasler, Nov 03 2020
-
from itertools import count, islice
def agen(only="0123"):
digset, valid = set(only), set(only)
for e in count(1):
found, newvalid = set(), set()
for tstr in valid:
t = int(tstr)
if (tstr == "0" or tstr[0] != "0") and set(str(t**2)) <= digset:
found.add(t)
for d in digset:
dtstr = d + tstr
dt = int(dtstr)
remstr = str(dt**2)[-e:]
if set(remstr) <= digset:
newvalid.add(dtstr)
valid = newvalid
yield from sorted(found)
print(list(islice(agen(), 50))) # Michael S. Branicky, Jul 07 2022
Showing 1-2 of 2 results.
Comments