This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A136809 #48 Jul 07 2022 12:27:33 %S A136809 0,1,10,11,100,101,110,111,1000,1001,1010,1011,1100,1101,1110,10000, %T A136809 10001,10010,10011,10100,10101,10110,10111,11000,11001,11010,11100, %U A136809 11101,100000,100001,100010,100011,100100,100101,100110,100111,101000,101001,101010,101011,101100,101110,110000,110001,110010,110100,110101,111000,111001,111010 %N A136809 Numbers k such that k and k^2 use only the digits 0, 1, 2 and 3. %C A136809 Generated with "DrScheme". %C A136809 Subsequence of A136810-A136815. - _M. F. Hasler_, Jan 24 2008 %C A136809 From _M. F. Hasler_, Nov 03 2020: (Start) %C A136809 A136813(144) = 31733311 is the first term of that sequence which is not in this sequence. All others among A136810-A136815 differ much earlier. %C A136809 If a(n) is a term then so is 10*a(n). Conjecture: the sequence contains only "binary numbers" (digits 0 or 1) having no more than three 1's in a row, and not more than one run of two or more consecutive 1's. (But not all such numbers, since 101101 for example is not in the sequence.) (End) %C A136809 Here is a counterexample with two instances of two consecutive ones, i.e., two non-overlapping occurrences of the substring 11: 110010000010100001010000010011^2 = 12102200102222202222322212223022221222322220222220100220121. - _Michael S. Branicky_, Nov 04 2020 %C A136809 One cannot test candidates digit-by-digit from the right. Specifically, a suffix of the valid counterexample above is invalid: 10100001010000010011^2 = 102010020402001222322220222220100220121. - _Michael S. Branicky_, Nov 05 2020 %C A136809 With respect to the conjectures and comment above, only digits 0 and 1 occur and no 1111's occur in the first 83990 terms (all with <= 25 digits). These were generated incrementally from the right based on partial screening (see Python program). - _Michael S. Branicky_, Jul 07 2022 %H A136809 Michael S. Branicky, <a href="/A136809/b136809.txt">Table of n, a(n) for n = 1..12670</a> (all terms with <= 19 digits; terms 1..1380 from Jonathan Wellons) %H A136809 Jonathan Wellons, <a href="https://web.archive.org/web/20090206165028/http://jonathanwellons.com/shared-digits/">Tables of Shared Digits</a> %e A136809 111^2 = 12321, %e A136809 11101^2 = 123232201, and %e A136809 101011^2 = 10203222121, %e A136809 111001^2 = 12321222001, so 111, 11101, 101011 and 111001 are in the sequence, but: %e A136809 110011^2 = 12102420121, so 110011 is not in the sequence; also %e A136809 1100011^2 = 1210024200121, so 1100011 is not in the sequence, and %e A136809 1010101^2 = 1020304030201, so 1010101 is not in the sequence; but %e A136809 1110001^2 = 1232102220001, so 1110001 is in the sequence; also %e A136809 1010100100001^2 = 1020302212022030200200001. %t A136809 Select[Range[0,200000],And@@(ContainsAll[{0,1,2,3},Union@IntegerDigits@#]&/@{#,#^2})&] (* _Giorgos Kalogeropoulos_, May 21 2021 *) %t A136809 With[{c={0,1,2,3}},Select[FromDigits/@Tuples[c,6],SubsetQ[c,IntegerDigits[ #^2]]&]] (* _Harvey P. Dale_, Jun 01 2021 *) %o A136809 (PARI) 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 %o A136809 (Python) %o A136809 from itertools import count, islice %o A136809 def agen(only="0123"): %o A136809 digset, valid = set(only), set(only) %o A136809 for e in count(1): %o A136809 found, newvalid = set(), set() %o A136809 for tstr in valid: %o A136809 t = int(tstr) %o A136809 if (tstr == "0" or tstr[0] != "0") and set(str(t**2)) <= digset: %o A136809 found.add(t) %o A136809 for d in digset: %o A136809 dtstr = d + tstr %o A136809 dt = int(dtstr) %o A136809 remstr = str(dt**2)[-e:] %o A136809 if set(remstr) <= digset: %o A136809 newvalid.add(dtstr) %o A136809 valid = newvalid %o A136809 yield from sorted(found) %o A136809 print(list(islice(agen(), 50))) # _Michael S. Branicky_, Jul 07 2022 %Y A136809 Cf. A007088 (binary numbers), A136808 (subsequence: only 0, 1, 2), A136810, A136811, A136812, A136813, A136814, A136815. %K A136809 base,nonn %O A136809 1,3 %A A136809 Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008