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.

A061230 Numbers k such that k + the reversal of k is a square.

This page as a plain text file.
%I A061230 #39 Dec 11 2022 04:48:44
%S A061230 0,2,8,29,38,47,56,65,74,83,92,110,143,164,198,242,263,297,341,362,
%T A061230 396,440,461,495,560,594,693,792,891,990,10100,10148,10340,10395,
%U A061230 10403,10683,10908,10980,11138,11330,11385,11673,11970,12128,12320,12375
%N A061230 Numbers k such that k + the reversal of k is a square.
%H A061230 Michael S. Branicky, <a href="/A061230/b061230.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Paolo P. Lava)
%e A061230 8 is a term as 8 + 8 = 16 = 4^2.
%e A061230 56 is a term as 56 + 65 = 121 = 11^2.
%p A061230 digrev:= proc(n) local L,i;
%p A061230   L:= convert(n,base,10);
%p A061230   add(L[-i]*10^(i-1),i=1..nops(L))
%p A061230 end proc:
%p A061230 select(t -> issqr(t+digrev(t)),[$0..20000]); # _Robert Israel_, May 04 2015
%t A061230 Select[Range[0,15000],IntegerQ[Sqrt[#+FromDigits[Reverse[ IntegerDigits[#]]]]]&]  (* _Harvey P. Dale_, Apr 18 2011 *)
%o A061230 (PARI) isok(n) = issquare(n + fromdigits(Vecrev(digits(n)))); \\ _Michel Marcus_, Aug 04 2019
%o A061230 (Python)
%o A061230 from math import isqrt
%o A061230 def issquare(n): return isqrt(n)**2 == n
%o A061230 def ok(n): return issquare(n + int(str(n)[::-1]))
%o A061230 print([k for k in range(12376) if ok(k)]) # _Michael S. Branicky_, Dec 09 2022
%Y A061230 Cf. A056964, A061231.
%Y A061230 Cf. A359011 (for squares).
%K A061230 nonn,base
%O A061230 1,2
%A A061230 _Amarnath Murthy_, Apr 23 2001
%E A061230 Corrected and extended by _Patrick De Geest_, May 28 2001
%E A061230 Edited by _N. J. A. Sloane_, Jul 24 2009