cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 13 results. Next

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

Views

Author

Giovanni Resta, Aug 10 2015

Keywords

Comments

It is known that a(n) > 0 for every n, i.e., every number can be written as the sum of 3 palindromes.
The graph has a kind of self-similarity: looking at the first 100 values, there is a Gaussian-shaped peak centered at the first local maximum a(15) = 18. Looking at the first 10000 values, one sees just one Gaussian-shaped peak centered around the record and local maximum a(1453) = 766, but to both sides of this value there are smaller peaks, roughly at distances which are multiples of 10. In the range [1..10^6], one sees a Gaussian-shaped peak centered around the record a(164445) = 57714. In the range [1..3*10^7], there is a similar peak of height ~ 4.3*10^6 at 1.65*10^7, with smaller neighbor peaks at distances which are multiples of 10^6, etc. - M. F. Hasler, Sep 09 2018

Examples

			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.
		

Crossrefs

See A261422 for another version.

Programs

  • Maple
    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
  • Mathematica
    pal=Select[Range[0, 1000], (d = IntegerDigits@ #; d == Reverse@ d)&]; a[n_] := Length@ IntegerPartitions[n, {3}, pal]; a /@ Range[0, 1000]
  • PARI
    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

Formula

a(n) = Sum_{k=0..3} A319453(n,k). - Alois P. Heinz, Sep 19 2018

Extensions

Examples revised and plots for large n added by Hugo Pfoertner, Aug 11 2015

A091580 Number of partitions of n into decimal palindromes.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 41, 55, 74, 96, 126, 162, 208, 263, 333, 415, 518, 639, 788, 962, 1174, 1420, 1716, 2060, 2468, 2940, 3497, 4137, 4886, 5747, 6744, 7885, 9203, 10702, 12424, 14379, 16611, 19136, 22009, 25245, 28915, 33037, 37688, 42901, 48765
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 22 2004

Keywords

Examples

			n=12: there are A000041(12)=77 partitions of 12, 3 of them contain non-palindromes: 12=10+2, 12=10+1+1 and 12 itself, therefore a(12)=77-3=74.
		

Crossrefs

Different from A088669 and from A000041.
Row sums of A319453.

Programs

  • Maple
    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, 1,
          b(n, h(i-1))+b(n-i, h(min(n-i, i))))
        end:
    a:= n-> b(n, h(n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 19 2018

Extensions

a(0)=1 prepended by Alois P. Heinz, Sep 17 2018

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

Original entry on oeis.org

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, 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, 6, 6, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 8, 7, 7, 7, 7, 7
Offset: 0

Views

Author

Giovanni Resta, Aug 10 2015

Keywords

Comments

Conjecture: a(n) > 0 for n > 2, i.e., every number greater than 2 can be written as the sum of 3 positive palindromes.
The conjecture is true (see links). - Giorgos Kalogeropoulos, May 10 2025

Examples

			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.
		

Crossrefs

Column k=3 of A319453.

Programs

  • Maple
    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`(i<1 or
          t<1, 0, b(n, h(i-1), t)+b(n-i, h(min(n-i, i)), t-1)))
        end:
    a:= n-> (k-> b(n, h(n), k)-b(n, h(n), k-1))(3):
    seq(a(n), n=0..120);  # Alois P. Heinz, Sep 19 2018
  • Mathematica
    pal=Select[Range@ 1000, (d = IntegerDigits@ #; d == Reverse@ d)&]; a[n_] := Length@ IntegerPartitions[n, {3}, pal]; a /@ Range[0, 1000]
    Table[Count[IntegerPartitions[n,{3}],?(AllTrue[#,PalindromeQ]&)],{n,0,90}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Mar 26 2021 *)

A319468 Number of partitions of n into exactly two nonzero decimal palindromes.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 4, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Crossrefs

Column k=2 of A319453.

Programs

  • Maple
    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):
    seq(a(n), n=0..100);

Formula

a(n) = [x^n y^2] 1/Product_{j>=2} (1-y*x^A002113(j)).
a(n) = 0 <=> n in { A319477 }.

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

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Comments

Every integer larger than two can be obtained by adding exactly three nonzero decimal palindromes.
The nonzero palindromes of this sequence are in A213879.

Crossrefs

Cf. A002113, A035137 (allowing zero), A213879, A261131, A319453, A319468, A319586.

Programs

  • Maple
    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);

Formula

A319468(a(n)) = 0.

A319469 Number of partitions of n into exactly four nonzero decimal palindromes.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 2, 3, 5, 6, 9, 11, 15, 17, 22, 24, 29, 31, 35, 36, 40, 39, 41, 39, 40, 37, 37, 33, 33, 29, 28, 25, 25, 22, 22, 21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26
Offset: 0

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Crossrefs

Column k=4 of A319453.
Cf. A002113.

Programs

  • Maple
    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))(4):
    seq(a(n), n=0..100);

Formula

a(n) = [x^n y^4] 1/Product_{j>=2} (1-y*x^A002113(j)).

A319470 Number of partitions of n into exactly five nonzero decimal palindromes.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 10, 13, 18, 22, 29, 34, 42, 48, 57, 63, 72, 77, 85, 88, 95, 96, 100, 99, 101, 98, 98, 93, 92, 87, 85, 80, 79, 74, 73, 70, 69, 67, 67, 65, 66, 65, 66, 66, 67, 68, 69, 70, 72, 73, 75, 76, 78, 79, 81, 81, 83, 83, 84, 84, 85, 84
Offset: 0

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Crossrefs

Column k=5 of A319453.
Cf. A002113.

Programs

  • Maple
    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))(5):
    seq(a(n), n=0..100);
  • Mathematica
    Table[Count[IntegerPartitions[n,{5}],?(AllTrue[#,PalindromeQ]&)],{n,0,70}] (* _Harvey P. Dale, Oct 20 2024 *)

Formula

a(n) = [x^n y^5] 1/Product_{j>=2} (1-y*x^A002113(j)).

A319471 Number of partitions of n into exactly six nonzero decimal palindromes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 11, 14, 20, 25, 34, 41, 53, 62, 76, 88, 104, 116, 134, 145, 163, 174, 189, 197, 211, 215, 225, 226, 232, 229, 233, 227, 228, 221, 219, 212, 211, 203, 201, 195, 194, 189, 190, 186, 187, 186, 188, 188, 192, 192, 197, 199, 204
Offset: 0

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Crossrefs

Column k=6 of A319453.
Cf. A002113.

Programs

  • Maple
    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))(6):
    seq(a(n), n=0..100);

Formula

a(n) = [x^n y^6] 1/Product_{j>=2} (1-y*x^A002113(j)).

A319472 Number of partitions of n into exactly seven nonzero decimal palindromes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 11, 15, 21, 27, 37, 46, 60, 73, 91, 108, 131, 151, 178, 201, 231, 256, 287, 311, 342, 365, 393, 412, 437, 450, 470, 479, 493, 496, 505, 503, 508, 503, 504, 496, 496, 487, 487, 479, 478, 472, 473, 469, 472, 471, 476, 477
Offset: 0

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Crossrefs

Column k=7 of A319453.
Cf. A002113.

Programs

  • Maple
    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))(7):
    seq(a(n), n=0..100);

Formula

a(n) = [x^n y^7] 1/Product_{j>=2} (1-y*x^A002113(j)).

A319473 Number of partitions of n into exactly eight nonzero decimal palindromes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 11, 15, 22, 28, 39, 49, 65, 80, 102, 123, 152, 179, 215, 248, 292, 331, 380, 423, 477, 522, 578, 623, 679, 721, 773, 811, 859, 889, 929, 953, 985, 1000, 1025, 1032, 1050, 1051, 1063, 1060, 1068, 1062, 1068, 1062, 1068
Offset: 0

Views

Author

Alois P. Heinz, Sep 19 2018

Keywords

Crossrefs

Column k=8 of A319453.
Cf. A002113.

Programs

  • Maple
    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))(8):
    seq(a(n), n=0..100);

Formula

a(n) = [x^n y^8] 1/Product_{j>=2} (1-y*x^A002113(j)).
Showing 1-10 of 13 results. Next