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 A249915 #48 Sep 23 2024 14:16:33 %S A249915 255465,652244,665256,2534665,2536656,2554262,6523462,6524235,6652242, %T A249915 23352656,23354365,23523462,23546665,23565325,25346665,25425256, %U A249915 25624665,25625465,65226242,65234535,235442656,254234662,255465525,255645525,256246665,256254665 %N A249915 Numbers k such that the decimal expansions of both k and k^2 have 2 as smallest digit and 6 as largest digit. %H A249915 Chai Wah Wu, <a href="/A249915/b249915.txt">Table of n, a(n) for n = 1..2000</a> (n = 1..42 from Robert Israel). %p A249915 M:= 10: %p A249915 B:= [[2],[3],[4],[5],[6]]: %p A249915 A:= NULL: %p A249915 for d from 2 to M do %p A249915 B:= map(b -> seq([op(b), i],i=2..6), B); %p A249915 C:= select(b -> max(b)=6 and min(b) = 2, B); %p A249915 X:= map(b -> add(b[i]*10^(d-i),i=1..d),C); %p A249915 X:= select(proc(x) local L; L:= convert(x^2,base,10); max(L) = 6 and min(L) = 2 end proc, X); %p A249915 A:= A, op(X); %p A249915 od: %p A249915 A; # _Robert Israel_, Apr 27 2015 %t A249915 fQ[n_] := Block[{d = DigitCount@ n}, Plus @@ Prepend[Take[d, -4], First@ d] == 0 && d[[2]] > 0 && d[[6]] > 0]; Select[Range@ 2600000, fQ@ # && fQ[#^2] &] (* _Michael De Vlieger_, Apr 27 2015 *) %o A249915 (PARI) is(n) = vecmin(digits(n))==2 && vecmin(digits(n^2))==2 && vecmax(digits(n))==6 && vecmax(digits(n^2))==6 %o A249915 (Python) %o A249915 from itertools import product %o A249915 A249915_list = [] %o A249915 for l in range(10): %o A249915 for a in product('23456', repeat = l): %o A249915 for b in ('2', '4', '5', '6'): %o A249915 s = ''.join(a)+b %o A249915 if '2' in s and '6' in s: %o A249915 n = int(s) %o A249915 if {'2', '6'} <= set(str(n**2)) <= {'2', '3', '4', '5', '6'}: %o A249915 A249915_list.append(n) # _Chai Wah Wu_, Apr 29 2015 %Y A249915 Cf. A137067, A137079, A137093, A256630, A256631, A256633, A256634, A256708, A256709, A256889, A257197, A257210, A257211, A256601, A257310. %K A249915 nonn,base %O A249915 1,1 %A A249915 _Felix Fröhlich_, Apr 21 2015