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 A385300 #31 Jul 10 2025 08:13:13 %S A385300 2,8,78,92,932,7798,51192,939398,5157798,7797578,7797978,9393978, %T A385300 15119592,15773398,53179378,53559332,77979998,79175932,155139378, %U A385300 157759592,517751738,535393932,917933998,939597798,1511979592,5157759592,7771757978,7775735378,9393959798 %N A385300 Integers k containing only odd digits, except the last digit, such that k^2 is composed of only even digits. %C A385300 Although the terms in this list contain only odd digits, except for the units digit, their squares have only even digits. %C A385300 The terms of the list are even numbers ending only in 2 or in 8. Proof: if n ends in 0, 4 or 6, since the penultimate digit of n is odd, then the last 2 digits of n can be: 10, 14, 16, 30, 34, 36, 50, 54, 56, 70, 74, 76, 90, 94 and 96. If n ends in 10, 30, 50, 70 or 90, then the antepenultimate digit of n^2 is odd, while in the other cases the penultimate digit of n^2 is odd. %C A385300 a(n) == 32, 38, 78, 92, 98 (mod 100), for n > 3. %C A385300 a(n) == 192, 332, 338, 378, 398, 578, 592, 738, 798, 932, 978, 992, 998 (mod 1000), for n > 4. - _Chai Wah Wu_, Jun 25 2025 %H A385300 David A. Corneth, <a href="/A385300/b385300.txt">Table of n, a(n) for n = 1..360</a> %H A385300 David A. Corneth, <a href="/A385300/a385300.gp.txt">PARI program</a> %e A385300 7798 is a term, since only the last digit is even and 7798^2 = 60808804, whose digits are all even. %t A385300 Select[Range[10^7],NoneTrue[Take[IntegerDigits[#],IntegerLength[#]-1],EvenQ]&&AllTrue[IntegerDigits[#^2],EvenQ]&] (* _James C. McMahon_, Jun 28 2025 *) %o A385300 (PARI) odd(n) = {my(k=1); while(n>5^k, n-=5^k; k++); fromdigits([2*d+1 | d<-digits(5^k+n-1, 5)]) - 3*10^k}; \\ A014261 %o A385300 lista(nn) = my(list=List()); forstep (e=2, 8, 2, if (#select(x->(x%2), digits(e^2)) == 0, listput(list, e));); for (n=1, nn, my(o=odd(n)); forstep (e=0, 8, 2, my(oe = 10*o+e); if (#select(x->(x%2), digits(oe^2)) == 0, listput(list, oe)););); Vec(list); \\ _Michel Marcus_, Jun 25 2025 %o A385300 (Python) %o A385300 from itertools import count, product, islice %o A385300 def A385300_gen(): # generator of terms %o A385300 for l in count(1): %o A385300 for d in product('13579',repeat=l): %o A385300 m = int(''.join(d))-1 %o A385300 if m>0 and set(str(m**2))<={'0','2','4','6','8'}: %o A385300 yield m %o A385300 A385300_list = list(islice(A385300_gen(),29)) # _Chai Wah Wu_, Jun 25 2025 %Y A385300 Cf. A000290, A014261, A030097, A136904. %K A385300 nonn,base %O A385300 1,1 %A A385300 _Gonzalo MartÃnez_, Jun 24 2025