login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A278328 Numbers n such that abs(n - rev(n)) is a square, where rev(n) is the decimal reverse of n (A004086). 2
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, 48, 51, 54, 55, 56, 59, 62, 65, 66, 67, 73, 76, 77, 78, 84, 87, 88, 89, 90, 95, 98, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

All palindromes are in this sequence, hence it is infinite.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..20000

MAPLE

a:= proc(n) option remember; local k; for k from 1+

      `if`(n=1, -1, a(n-1)) while not issqr(abs(k-(s->

       parse(cat(s[-i]$i=1..length(s))))(""||k))) do od: k

    end:

seq(a(n), n=1..100);  # Alois P. Heinz, Nov 18 2016

MATHEMATICA

Select[Range@ 262, IntegerQ@ Sqrt@ Abs[# - FromDigits@ Reverse@ IntegerDigits@ #] &] (* Michael De Vlieger, Nov 18 2016 *)

PROG

(Python 2.7.7)

import math

n = 0

while True:

    if math.sqrt(abs(n-int(str(n)[::-1])))%1 == 0:

        print n

    n += 1 # Jonathan Frech, Nov 18 2016

(PARI) is(n) = issquare(abs(n - eval(concat(Vecrev(Str(n)))))) \\ Felix Fröhlich, Nov 18 2016

(PARI) is(n, {b=10}) = issquare(abs(n - subst(Polrev(digits(n, b), 'x), 'x, b))); \\ Gheorghe Coserea, Nov 27 2016

CROSSREFS

A002113 is a subsequence.

Cf. A000290, A004086, A016766, A056965.

Sequence in context: A071204 A002796 A055471 * A066254 A167904 A004841

Adjacent sequences:  A278325 A278326 A278327 * A278329 A278330 A278331

KEYWORD

nonn,base

AUTHOR

Jonathan Frech, Nov 18 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 23 22:36 EST 2020. Contains 331177 sequences. (Running on oeis4.)