A261132
Number of ways to write n as the sum u+v+w of three palindromes (from A002113) with 0 <= u <= v <= w.
Original entry on oeis.org
1, 1, 2, 3, 4, 5, 7, 8, 10, 12, 13, 15, 16, 17, 17, 18, 17, 17, 16, 15, 13, 12, 11, 10, 9, 8, 7, 7, 6, 6, 6, 6, 5, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 12, 8, 8, 8
Offset: 0
a(0)=1 because 0 = 0+0+0;
a(1)=1 because 1 = 0+0+1;
a(2)=2 because 2 = 0+1+1 = 0+0+2;
a(3)=3 because 3 = 1+1+1 = 0+1+2 = 0+0+3.
a(28) = 6 since 28 can be expressed in 6 ways as the sum of 3 palindromes, namely, 28 = 0+6+22 = 1+5+22 = 2+4+22 = 3+3+22 = 6+11+11 = 8+9+11.
- Giovanni Resta, Table of n, a(n) for n = 0..10000
- Javier Cilleruelo and Florian Luca, Every positive integer is a sum of three palindromes, arXiv: 1602.06208 [math.NT], 2016-2017.
- Erich Friedman, Problem of the Month (June 1999)
- James Grime and Brady Haran, Every Number is the Sum of Three Palindromes, Numberphile video (2018)
- Hugo Pfoertner, Plot of first 10^6 terms
- Hugo Pfoertner, Plot of first 3*10^7 terms
- Hugo Pfoertner, Plot of low values in range 7*10^6 ... 10^7
-
A261132 := proc(n)
local xi,yi,x,y,z,a ;
a := 0 ;
for xi from 1 do
x := A002113(xi) ;
if 3*x > n then
return a;
end if;
for yi from xi do
y := A002113(yi) ;
if x+2*y > n then
break;
else
z := n-x-y ;
if z >= y and isA002113(z) then
a := a+1 ;
end if;
end if;
end do:
end do:
return a;
end proc:
seq(A261132(n),n=0..80) ; # R. J. Mathar, Sep 09 2015
-
pal=Select[Range[0, 1000], (d = IntegerDigits@ #; d == Reverse@ d)&]; a[n_] := Length@ IntegerPartitions[n, {3}, pal]; a /@ Range[0, 1000]
-
A261132(n)=n||return(1); my(c=0, i=inv_A002113(n)); A2113[i] > n && i--; until( A2113[i--]*3 < n, j = inv_A002113(D = n-A2113[i]); if( j>i, j=i, A2113[j] > D && j--); while( j >= k = inv_A002113(D - A2113[j]), A2113[k] == D - A2113[j] && c++; j--||break));c \\ For efficiency, this uses an array A2113 precomputed at least up to n. - M. F. Hasler, Sep 10 2018
Examples revised and plots for large n added by
Hugo Pfoertner, Aug 11 2015
A319453
Number T(n,k) of partitions of n into exactly k nonzero decimal palindromes; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
Original entry on oeis.org
1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 2, 1, 1, 0, 1, 3, 3, 2, 1, 1, 0, 1, 3, 4, 3, 2, 1, 1, 0, 1, 4, 5, 5, 3, 2, 1, 1, 0, 1, 4, 7, 6, 5, 3, 2, 1, 1, 0, 0, 5, 8, 9, 7, 5, 3, 2, 1, 1, 0, 1, 4, 10, 11, 10, 7, 5, 3, 2, 1, 1, 0, 0, 5, 11, 15, 13, 11, 7, 5, 3, 2, 1, 1
Offset: 0
Triangle T(n,k) begins:
1;
0, 1;
0, 1, 1;
0, 1, 1, 1;
0, 1, 2, 1, 1;
0, 1, 2, 2, 1, 1;
0, 1, 3, 3, 2, 1, 1;
0, 1, 3, 4, 3, 2, 1, 1;
0, 1, 4, 5, 5, 3, 2, 1, 1;
0, 1, 4, 7, 6, 5, 3, 2, 1, 1;
0, 0, 5, 8, 9, 7, 5, 3, 2, 1, 1;
0, 1, 4, 10, 11, 10, 7, 5, 3, 2, 1, 1;
0, 0, 5, 11, 15, 13, 11, 7, 5, 3, 2, 1, 1;
...
Columns k=0-10 give:
A000007,
A136522 (for n>0),
A319468,
A261131,
A319469,
A319470,
A319471,
A319472,
A319473,
A319474,
A319475.
-
p:= proc(n) option remember; local i, s; s:= ""||n;
for i to iquo(length(s), 2) do if
s[i]<>s[-i] then return false fi od; true
end:
h:= proc(n) option remember; `if`(n<1, 0,
`if`(p(n), n, h(n-1)))
end:
b:= proc(n, i) option remember; `if`(n=0 or i=1, x^n,
b(n, h(i-1))+expand(x*b(n-i, h(min(n-i, i)))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, h(n))):
seq(T(n), n=0..14);
A341156
Number of partitions of n into 3 distinct nonzero decimal palindromes.
Original entry on oeis.org
1, 1, 2, 3, 4, 5, 7, 7, 9, 9, 10, 9, 10, 8, 8, 7, 6, 4, 4, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 4, 6, 6, 6, 6, 6, 6, 6, 6
Offset: 6
A341192
Number of ways to write n as an ordered sum of 3 nonzero decimal palindromes.
Original entry on oeis.org
1, 3, 6, 10, 15, 21, 28, 36, 45, 52, 60, 66, 70, 72, 72, 70, 66, 60, 55, 45, 39, 34, 30, 27, 25, 24, 24, 24, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 30, 27, 27, 30, 30, 30, 30, 30, 30, 30, 30, 33, 27, 30, 33, 33, 33, 33, 33, 33, 33, 33, 36, 27, 34, 36, 36, 36, 36
Offset: 3
-
nmax = 70; CoefficientList[Series[Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]^3, {x, 0, nmax}], x] // Drop[#, 3] &
A319477
Nonnegative integers which cannot be obtained by adding exactly two nonzero decimal palindromes.
Original entry on oeis.org
0, 1, 21, 32, 43, 54, 65, 76, 87, 98, 111, 131, 141, 151, 161, 171, 181, 191, 201, 1031, 1041, 1042, 1051, 1052, 1053, 1061, 1062, 1063, 1064, 1071, 1072, 1073, 1074, 1075, 1081, 1082, 1083, 1084, 1085, 1086, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1099
Offset: 1
- Alois P. Heinz, Table of n, a(n) for n = 1..65536
- Javier Cilleruelo, Florian Luca and Lewis Baxter, Every positive integer is a sum of three palindromes, arXiv: 1602.06208 [math.NT], 2017, Math. Comp. 87 (2018), 3023-3055.
- James Grime and Brady Haran, Every Number is the Sum of Three Palindromes, Numberphile video (2018)
-
p:= proc(n) option remember; local i, s; s:= ""||n;
for i to iquo(length(s), 2) do if
s[i]<>s[-i] then return false fi od; true
end:
h:= proc(n) option remember; `if`(n<1, 0,
`if`(p(n), n, h(n-1)))
end:
b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i (k-> b(n, h(n), k)-b(n, h(n), k-1))(2):
a:= proc(n) option remember; local j; for j from 1+
`if`(n=1, -1, a(n-1)) while g(j)<>0 do od; j
end:
seq(a(n), n=1..80);
A282585
Number of ways to write n as an ordered sum of 3 squarefree palindromes (A071251).
Original entry on oeis.org
0, 0, 0, 1, 3, 6, 7, 9, 12, 19, 21, 21, 18, 24, 27, 28, 18, 18, 19, 24, 15, 10, 6, 12, 12, 12, 9, 9, 12, 15, 18, 12, 9, 7, 15, 15, 15, 9, 12, 15, 18, 18, 12, 9, 9, 18, 15, 12, 0, 9, 9, 9, 0, 0, 0, 6, 6, 9, 12, 9, 12, 15, 18, 18, 12, 9, 13, 18, 18, 18, 9, 15, 18, 21, 18, 12, 9, 15, 21, 21, 21, 9, 18, 21, 24, 18
Offset: 0
a(22) = 6 because we have [11, 6, 5], [11, 5, 6] [6, 11, 5], [6, 5, 11], [5, 11, 6] and [5, 6, 11].
Cf.
A002113,
A005117,
A035137,
A071251,
A091580,
A091581,
A260254,
A261131,
A261132,
A261422,
A280210,
A282584.
-
nmax = 85; CoefficientList[Series[Sum[Boole[SquareFreeQ[k] && PalindromeQ[k]] x^k, {k, 1, nmax}]^3, {x, 0, nmax}], x]
A282845
Number of ways to write n as an ordered sum of 6 prime power palindromes (A084092).
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 1, 6, 21, 56, 126, 246, 432, 702, 1077, 1576, 2232, 3072, 4112, 5352, 6801, 8422, 10197, 12102, 14117, 16146, 18177, 20112, 21882, 23382, 24661, 25566, 26136, 26316, 26181, 25560, 24677, 23436, 21981, 20226, 18486, 16536, 14642, 12702, 10962, 9166, 7662, 6222, 5042, 3912, 3096, 2306, 1746, 1236, 921, 600
Offset: 0
a(7) = 6 because we have:
[2, 1, 1, 1, 1, 1]
[1, 2, 1, 1, 1, 1]
[1, 1, 2, 1, 1, 1]
[1, 1, 1, 2, 1, 1]
[1, 1, 1, 1, 2, 1]
[1, 1, 1, 1, 1, 2]
-
nmax = 55; CoefficientList[Series[(x + Sum[Boole[PrimePowerQ[k] && PalindromeQ[k]] x^k, {k, 1, nmax}])^6, {x, 0, nmax}], x]
Showing 1-7 of 7 results.
Comments