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.

A278328 Numbers n such that abs(n - rev(n)) is a square, where rev(n) is the decimal reverse of n (A004086).

This page as a plain text file.
%I A278328 #59 Feb 23 2025 15:12:55
%S A278328 0,1,2,3,4,5,6,7,8,9,10,11,12,15,21,22,23,26,32,33,34,37,40,43,44,45,
%T A278328 48,51,54,55,56,59,62,65,66,67,73,76,77,78,84,87,88,89,90,95,98,99,
%U A278328 101,111,121,131,141,151,161,171,181,191,202,212,222,232,242,252,262
%N A278328 Numbers n such that abs(n - rev(n)) is a square, where rev(n) is the decimal reverse of n (A004086).
%C A278328 All palindromes are in this sequence, hence it is infinite.
%H A278328 Alois P. Heinz, <a href="/A278328/b278328.txt">Table of n, a(n) for n = 1..20000</a>
%p A278328 a:= proc(n) option remember; local k; for k from 1+
%p A278328       `if`(n=1, -1, a(n-1)) while not issqr(abs(k-(s->
%p A278328        parse(cat(s[-i]$i=1..length(s))))(""||k))) do od: k
%p A278328     end:
%p A278328 seq(a(n), n=1..100);  # _Alois P. Heinz_, Nov 18 2016
%t A278328 Select[Range@ 262, IntegerQ@ Sqrt@ Abs[# - FromDigits@ Reverse@ IntegerDigits@ #] &] (* _Michael De Vlieger_, Nov 18 2016 *)
%o A278328 (Python)
%o A278328 import math
%o A278328 n = 0
%o A278328 while True:
%o A278328     if math.sqrt(abs(n-int(str(n)[::-1])))%1 == 0:
%o A278328         print(n)
%o A278328     n += 1 # _Jonathan Frech_, Nov 18 2016
%o A278328 (PARI) is(n) = issquare(abs(n - eval(concat(Vecrev(Str(n)))))) \\ _Felix Fröhlich_, Nov 18 2016
%o A278328 (PARI) is(n, {b=10}) = issquare(abs(n - subst(Polrev(digits(n, b),'x),'x,b))); \\ _Gheorghe Coserea_, Nov 27 2016
%Y A278328 A002113 is a subsequence.
%Y A278328 Cf. A000290, A004086, A016766, A056965.
%K A278328 nonn,base
%O A278328 1,3
%A A278328 _Jonathan Frech_, Nov 18 2016