The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A331472 Consider the different ways to split the decimal representation of n into palindromic parts; a(n) is the greatest possible sum of the parts of such a split. 2

%I #10 Jan 19 2020 05:01:22

%S 0,1,2,3,4,5,6,7,8,9,1,11,3,4,5,6,7,8,9,10,2,3,22,5,6,7,8,9,10,11,3,4,

%T 5,33,7,8,9,10,11,12,4,5,6,7,44,9,10,11,12,13,5,6,7,8,9,55,11,12,13,

%U 14,6,7,8,9,10,11,66,13,14,15,7,8,9,10,11,12,13

%N Consider the different ways to split the decimal representation of n into palindromic parts; a(n) is the greatest possible sum of the parts of such a split.

%C Leading zeros are forbidden in the decimal representation of n; however we allow leading zeros in the palindromic parts.

%H Rémy Sigrist, <a href="/A331472/b331472.txt">Table of n, a(n) for n = 0..10000</a>

%H Rémy Sigrist, <a href="/A331472/a331472.gp.txt">PARI program for A331472</a>

%F a(n) <= n with equality iff n belongs to A002113.

%e For n = 1664:

%e - we can split this number into "1" and "6" and "6" and "4",

%e - or into "1" and "66" and "4",

%e - hence a(1664) = max(16, 71) = 71.

%t palQ[w_] := w == Reverse@w; ric[tg_, cr_] := Block[{m = Length@tg, t}, If[m == 0, Sow@ Total[ FromDigits /@ cr], Do[ If[ palQ[t = Take[tg, k]], ric[Drop[tg, k], Join[ cr, {t}]]], {k, m}]]]; a[n_] := Max[ Reap[ ric[ IntegerDigits[n], {}]][[2, 1]]]; a /@ Range[0, 99] (* _Giovanni Resta_, Jan 19 2020 *)

%o (PARI) See Links section.

%Y Cf. A002113, A331471 (binary analog).

%K nonn,base

%O 0,3

%A _Rémy Sigrist_, Jan 17 2020

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 11 23:47 EDT 2024. Contains 373319 sequences. (Running on oeis4.)