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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A184988 Largest palindromic substring of n^2. 1
0, 1, 4, 9, 6, 5, 6, 9, 6, 8, 1, 121, 44, 9, 9, 22, 6, 9, 4, 6, 4, 44, 484, 9, 7, 6, 676, 9, 8, 8, 9, 9, 4, 9, 11, 22, 9, 9, 444, 5, 6, 8, 7, 9, 9, 202, 11, 22, 4, 4, 5, 6, 7, 9, 9, 5, 313, 9, 33, 8, 6, 7, 44, 969, 9, 22, 6, 44, 6, 7, 9, 5, 8, 9, 7, 6, 77, 929 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Leading 0's are not allowed, so a(103) = 9, not 060. - Robert Israel, Nov 05 2020

LINKS

Robert Israel, Table of n, a(n) for n = 0..10000

FORMULA

a(n) = A047813(A000290(n)).

EXAMPLE

a(15) = largest palindromic substring of 15^2 = largest palindromic substring of 225 = 22.

MAPLE

g:= proc(S) S[1] <> "0" and S = StringTools:-Reverse(S) end proc:

f:= proc(n) local S, d, l, i, Q;

  S:= sprintf("%d", n^2);

  d:= length(S);

  for l from d to 1 by -1 do

    Q:= select(g, [seq(S[i..i+l-1], i=1..d+1-l)]);

    if Q <> [] then return op(sscanf(max(Q), "%d")) fi

  od;

end proc:

f(0):= 0:

map(f, [$0..200]); # Robert Israel, Nov 05 2020

CROSSREFS

Cf. A000290, A002113, A047813.

Sequence in context: A316347 A169917 A059729 * A108533 A200414 A347215

Adjacent sequences:  A184985 A184986 A184987 * A184989 A184990 A184991

KEYWORD

nonn,base,easy,look

AUTHOR

Jonathan Vos Post, Mar 27 2011

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 October 25 13:27 EDT 2021. Contains 348252 sequences. (Running on oeis4.)