cp's OEIS Frontend

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.

A034822 Numbers k such that there are no palindromic squares of length k.

This page as a plain text file.
%I A034822 #28 Feb 16 2025 08:32:37
%S A034822 2,4,8,10,14,18,20,24,30,38,40
%N A034822 Numbers k such that there are no palindromic squares of length k.
%C A034822 All terms are even since (10^k+1)^2 is a palindrome of length 2*k+1. a(12) >= 46 if it exists (see A263618). - _Chai Wah Wu_, Jun 14 2024
%H A034822 Patrick De Geest, <a href="https://www.worldofnumbers.com/nobase10pg2.htm">Palindromic Squares in bases 2 to 17</a>
%H A034822 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PalindromicNumber.html">Palindromic Number</a>
%t A034822 A034822[n_] := Select[Range[Ceiling[Sqrt[10^(n - 1)]], Floor[Sqrt[10^n]]], #^2 == IntegerReverse[#^2] &];
%t A034822 Select[Range[12], Length[A034822[#]] == 0 &] (* _Robert Price_, Apr 23 2019 *)
%o A034822 (Python)
%o A034822 from sympy import integer_nthroot as iroot
%o A034822 def ispal(n): s = str(n); return s == s[::-1]
%o A034822 def ok(n):
%o A034822   for r in range(iroot(10**(n-1), 2)[0] + 1, iroot(10**n, 2)[0]):
%o A034822     if ispal(r*r): return False
%o A034822   return True
%o A034822 print([m for m in range(1, 16) if ok(m)]) # _Michael S. Branicky_, Feb 04 2021
%Y A034822 Cf. A002778, A002779, A034307, A263618.
%K A034822 nonn,base,hard,more
%O A034822 1,1
%A A034822 _Patrick De Geest_, Oct 15 1998
%E A034822 Two more terms from _Patrick De Geest_, Apr 01 2002