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.

A260726 a(n) = smallest palindrome k > n such that k/n is a square; a(n) = 0 if no solution exists.

This page as a plain text file.
%I A260726 #32 May 10 2025 15:18:48
%S A260726 4,8,363,484,5445,46464,252,2138312,12321,0,44,23232,31213,686,
%T A260726 53187678135,44944,272,24642,171,0,525,88,575,46464,5221225,62426,
%U A260726 36963,252,464,0,1783799973871,291080192,2112,4114,53235,69696,333,20102,93639,0,656,858858
%N A260726 a(n) = smallest palindrome k > n such that k/n is a square; a(n) = 0 if no solution exists.
%C A260726 If n is a multiple of 10 then a(n) = 0, since no palindrome ends in 0.
%C A260726 Up to 200 only 3 terms are currently unknown, a(125) > 5.2*10^28, a(177) > 3.5*10^27 and a(185) > 4.5*10^27. See Links for a table of known values. - _Giovanni Resta_, Aug 05 2015
%C A260726 If a(125) > 0, then the first 3 digits of a(125) are 521 and the last 3 digits of a(125) are 125. Proof: Let m^2 = a(125)/125. Then m is odd as otherwise 125*m^2 is a multiple of 10 which is not a palindrome. Since m is odd, m^2 == 1 mod 8 and thus 125*m^2 == 125 mod 1000. - _Chai Wah Wu_, Mar 31 2016
%H A260726 Giovanni Resta, <a href="/A260726/a260726.txt">Known values up to a(200)</a>
%e A260726 a(3) = 363, because 363/3 = 11^2. 363 * 3 = 1089, which is also a square.
%e A260726 a(15) = 53187678135, because 53187678135/15 = 59547^2 and 53187678135 * 15 = 893205^2.
%p A260726 ispali:= proc(n) local L; L:= convert(n,base,10); ListTools:-Reverse(L)=L end proc:
%p A260726 f:= proc(n) local m;
%p A260726    if n mod 10 = 0 then return 0 fi;
%p A260726    for m from 2 to 10^6 do if ispali(m^2*n) then return m^2*n fi od:
%p A260726    -1  # signals time-out
%p A260726 end proc:
%p A260726 seq(f(n), n=1..50); # _Robert Israel_, Aug 21 2015
%t A260726 palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; a[n_] := If[ Mod[n, 10] == 0, 0, Block[{q = 2}, While[! palQ[q^2 * n], q++]; q^2 * n]]; Array[a, 42] (* _Giovanni Resta_, Aug 18 2015 *)
%o A260726 (Python)
%o A260726 def a(n):
%o A260726     if n % 10 == 0: return 0
%o A260726     for c in range(2, 10**8):
%o A260726         k = str(n * c**2)
%o A260726         if k == k[::-1]:
%o A260726             return int(k)
%o A260726     return -1
%o A260726 print(*[a(n) for n in range(1, 43)], sep=', ')
%o A260726 # Corrected by _David Radcliffe_, May 10 2025
%Y A260726 Cf. A002113, A000290, A023108, A061563.
%K A260726 nonn,base
%O A260726 1,1
%A A260726 _Pieter Post_, Jul 30 2015
%E A260726 Missing a(13) from _Giovanni Resta_, Aug 05 2015