[go: up one dir, main page]

login
Revision History for A184988 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Largest palindromic substring of n^2.
(history; published version)
#13 by N. J. A. Sloane at Thu Nov 05 15:39:45 EST 2020
STATUS

proposed

approved

#12 by Robert Israel at Thu Nov 05 15:28:55 EST 2020
STATUS

editing

proposed

#11 by Robert Israel at Thu Nov 05 13:14:18 EST 2020
KEYWORD

nonn,base,easy,changed,look

#10 by Robert Israel at Thu Nov 05 13:13:38 EST 2020
COMMENTS

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

LINKS

Robert Israel, <a href="/A184988/b184988.txt">Table of n, a(n) for n = 0..10000</a>

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

STATUS

approved

editing

#9 by Russ Cox at Fri Mar 30 18:40:58 EDT 2012
AUTHOR

_Jonathan Vos Post (jvospost3(AT)gmail.com), _, Mar 27 2011

Discussion
Fri Mar 30
18:40
OEIS Server: https://oeis.org/edit/global/228
#8 by T. D. Noe at Tue Mar 29 13:32:42 EDT 2011
STATUS

proposed

approved

#7 by T. D. Noe at Tue Mar 29 13:32:35 EDT 2011
COMMENTS

There's a slight ambiguity in the definition, given, for example, 20^2 = 400 but "00" is not an integer in OEIS format.

#6 by Alois P. Heinz at Mon Mar 28 21:10:51 EDT 2011
KEYWORD

nonn,base,easy,more,changed

#5 by Alois P. Heinz at Mon Mar 28 21:04:44 EDT 2011
DATA

0, 1, 4, 9, 6, 5, 6, 9, 6, 8, 1, 121, 44, 9, 9, 22, 6, 9, 4, 6, 2, 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

FORMULA

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

EXAMPLE

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

Discussion
Mon Mar 28
21:07
Alois P. Heinz: I think you can remove your comment, because the value of "00" is 0 and then there is always another palindromic substring with larger value.
#4 by Jonathan Vos Post at Sun Mar 27 22:00:58 EDT 2011
NAME

allocated for Jonathan Vos PostLargest palindromic substring of n^2.

DATA

0, 1, 4, 9, 6, 5, 6, 9, 6, 8, 1, 121, 44, 9, 9, 22, 6, 9, 4, 6, 2, 44, 484

OFFSET

0,3

COMMENTS

There's a slight ambiguity in the definition, given, for example, 20^2 = 400 but "00" is not an integer in OEIS format.

FORMULA
EXAMPLE

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

CROSSREFS
KEYWORD

allocated

nonn,base,easy,more

AUTHOR

Jonathan Vos Post (jvospost3(AT)gmail.com), Mar 27 2011

STATUS

approved

proposed