A354256 Squares that remain square when written backward, are not divisible by 10, and have an even number of digits.
1089, 9801, 698896, 10036224, 42263001, 637832238736, 1021178969603881, 1883069698711201, 4099923883299904, 6916103777337773016196
Offset: 1
Examples
There are no 2-digit terms. The smallest 4-digit multiple of 121 is 1089 = 33^2, which happens to be a(1); its digit reversal is a(2) = 9801 = 99^2. The only 6-digit term is the palindrome a(3) = 698896 = 836^2. The only 8-digit terms are a(4) = 10036224 = 3168^2 and its digit reversal a(5) = 42263001 = 6501^2. There are no 10-digit terms. The only 12-digit term is the palindrome a(6) = 637832238736 = 798644^2. There are no 14-digit terms. There are three 16-digit terms: a(7) = 1021178969603881 = 31955891^2, its digit reversal a(8) = 1883069698711201 = 43394351^2, and the palindrome a(9) = 4099923883299904 = 64030648^2.
Programs
-
Mathematica
Select[Range[500000]^2,EvenQ[IntegerLength[#]]&&Mod[#,10]!=0&&IntegerQ[Sqrt[ IntegerReverse[ #]]]&] (* The program generates the first five terms of the sequence. *) (* Harvey P. Dale, Jul 28 2024 *)
-
Python
from math import isqrt from itertools import count, islice def sqr(n): return isqrt(n)**2 == n def agen(): yield from (k*k for k in count(1) if k%10 and len(s:=str(k*k))%2==0 and sqr(int(s[::-1]))) print(list(islice(agen(), 6))) # Michael S. Branicky, May 23 2022
-
Python
from math import isqrt from itertools import count, islice from sympy import integer_nthroot def A354256_gen(): # generator of terms for l in count(2,2): for m in (1,4,5,6,9): for k in range(1+isqrt(m*10**(l-1)-1),1+isqrt((m+1)*10**(l-1)-1)): if k % 10 and integer_nthroot(int(str(k*k)[::-1]),2)[1]: yield k*k A354256_list = list(islice(A354256_gen(),9)) # Chai Wah Wu, May 23 2022
Extensions
a(10) from Chai Wah Wu, May 24 2022
Comments