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!)
A261131 Number of ways to write n as the sum of 3 positive palindromes. 8

%I #16 Mar 26 2021 18:19:18

%S 0,0,0,1,1,2,3,4,5,7,8,10,11,13,13,15,14,15,14,14,12,12,9,9,8,7,6,6,5,

%T 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,5,6,6,6,6,6,6,6,6,

%U 6,6,5,7,7,7,7,7,7,7,7,7,7,5,8,7,7,7,7,7

%N Number of ways to write n as the sum of 3 positive palindromes.

%C Conjecture: a(n) > 0 for n > 2, i.e., every number greater than 2 can be written as the sum of 3 positive palindromes.

%H Giovanni Resta, <a href="/A261131/b261131.txt">Table of n, a(n) for n = 0..10000</a>

%e a(28) = 5 since 28 can be expressed in 5 ways as the sum of 3 positive palindromes, namely, 28 = 22+5+1 = 22+4+2 = 22+3+3 = 11+11+6 = 11+9+8.

%p p:= proc(n) option remember; local i, s; s:= ""||n;

%p for i to iquo(length(s), 2) do if

%p s[i]<>s[-i] then return false fi od; true

%p end:

%p h:= proc(n) option remember; `if`(n<1, 0,

%p `if`(p(n), n, h(n-1)))

%p end:

%p b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(i<1 or

%p t<1, 0, b(n, h(i-1), t)+b(n-i, h(min(n-i, i)), t-1)))

%p end:

%p a:= n-> (k-> b(n, h(n), k)-b(n, h(n), k-1))(3):

%p seq(a(n), n=0..120); # _Alois P. Heinz_, Sep 19 2018

%t pal=Select[Range@ 1000, (d = IntegerDigits@ #; d == Reverse@ d)&]; a[n_] := Length@ IntegerPartitions[n, {3}, pal]; a /@ Range[0, 1000]

%t Table[Count[IntegerPartitions[n,{3}],_?(AllTrue[#,PalindromeQ]&)],{n,0,90}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Mar 26 2021 *)

%Y Cf. A002113, A260254, A261132.

%Y Column k=3 of A319453.

%K nonn,base,look

%O 0,6

%A _Giovanni Resta_, Aug 10 2015

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 April 19 23:40 EDT 2024. Contains 371798 sequences. (Running on oeis4.)