A385300 Integers k containing only odd digits, except the last digit, such that k^2 is composed of only even digits.
2, 8, 78, 92, 932, 7798, 51192, 939398, 5157798, 7797578, 7797978, 9393978, 15119592, 15773398, 53179378, 53559332, 77979998, 79175932, 155139378, 157759592, 517751738, 535393932, 917933998, 939597798, 1511979592, 5157759592, 7771757978, 7775735378, 9393959798
Offset: 1
Examples
7798 is a term, since only the last digit is even and 7798^2 = 60808804, whose digits are all even.
Links
- David A. Corneth, Table of n, a(n) for n = 1..360
- David A. Corneth, PARI program
Programs
-
Mathematica
Select[Range[10^7],NoneTrue[Take[IntegerDigits[#],IntegerLength[#]-1],EvenQ]&&AllTrue[IntegerDigits[#^2],EvenQ]&] (* James C. McMahon, Jun 28 2025 *)
-
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 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
-
Python
from itertools import count, product, islice def A385300_gen(): # generator of terms for l in count(1): for d in product('13579',repeat=l): m = int(''.join(d))-1 if m>0 and set(str(m**2))<={'0','2','4','6','8'}: yield m A385300_list = list(islice(A385300_gen(),29)) # Chai Wah Wu, Jun 25 2025
Comments