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 11 results. Next

A035137 Numbers that are not the sum of 2 palindromes (where 0 is considered a palindrome).

Original entry on oeis.org

21, 32, 43, 54, 65, 76, 87, 98, 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, 1101, 1103, 1104, 1105, 1106, 1107, 1108
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1998

Keywords

Comments

Apparently, every positive number is equal to the sum of at most 3 positive palindromes. - Giovanni Resta, May 12 2013
A260254(a(n)) = 0. - Reinhard Zumkeller, Jul 21 2015
A261675(a(n)) >= 3 (and, conjecturally, = 3). - N. J. A. Sloane, Sep 03 2015
This sequence is infinite. Proof: It is easy to see that 200...01 (with any number of zeros) cannot be the sum of two palindromes. - N. J. A. Sloane, Sep 03 2015
The conjecture that every number is the sum of 3 palindromes fails iff there is a term a(n) such that for all palindromes P < a(n), the difference a(n) - P is also a term of this sequence. - M. F. Hasler, Sep 08 2015
Cilleruelo and Luca (see links) have proved the conjecture that every positive integer is the sum of at most three palindromes (in bases >= 5), and also that the density of those that require three is positive. - Christopher E. Thompson, Apr 14 2016

Crossrefs

Cf. A260254, A260255 (complement), A002113, A261906, A261907.
Cf. A319477 (disallowing zero).

Programs

  • Haskell
    a035137 n = a035137_list !! (n-1)
    a035137_list = filter ((== 0) . a260254) [0..]
    -- Reinhard Zumkeller, Jul 21 2015
    
  • Maple
    N:= 4: # to get all terms with <= N digits
    revdigs:= proc(n) local L,j,nL;
      L:= convert(n,base,10); nL:= nops(L);
      add(L[j]*10^(nL-j),j=1..nL);
    end proc;
    palis:= $0..9:
    for d from 2 to N do
      if d::even then
        palis:= palis, seq(x*10^(d/2)+revdigs(x),x=10^(d/2-1)..10^(d/2)-1)
      else
        palis:= palis, seq(seq(x*10^((d+1)/2)+y*10^((d-1)/2)+revdigs(x),y=0..9),x=10^((d-3)/2)..10^((d-1)/2)-1);
      fi
    od:
    palis:= [palis]:
    A:= Array(0..10^N-1):
    A[palis]:= 1:
    B:= SignalProcessing:-Convolution(A,A):
    select(t -> B[t+1] < 0.5, [$1..10^N-1]); # Robert Israel, Jun 22 2015
  • Mathematica
    palQ[n_]:=FromDigits[Reverse[IntegerDigits[n]]]==n; nn=1108; t={}; Do[i=c=0; While[i<=n && c!=1,If[palQ[i] && palQ[n-i], AppendTo[t,n]; c=1]; i++],{n,nn}]; Complement[Range[nn],t] (* Jayanta Basu, May 12 2013 *)
  • PARI
    is_A035137(n)={my(k=0);!until(n<2*k=nxt(k),is_A002113(n-k)&&return)} \\ Uses function nxt() given in A002113. Not very efficient for large n, better start with k=n-A261423(n). Maybe also better use A261423 rather than nxt(). - M. F. Hasler, Jul 21 2015

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

A260255 Numbers that can be written as the sum of two nonnegative palindromes in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 21 2015

Keywords

Comments

More than the usual number of terms are shown in order to distinguish this from A261906. - N. J. A. Sloane, Sep 09 2015
A260254(a(n)) > 0.

Crossrefs

Cf. A035137 (complement), A260254, A002113.
111 is a member of this sequence but not of A261906. A213879 lists the differences.

Programs

  • Haskell
    a260255 n = a260255_list !! (n-1)
    a260255_list = filter ((> 0) . a260254) [0..]
  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[idn = IntegerDigits[n, base]] == idn]; Take[ Union[ Plus @@@ Tuples[ Select[ Range[0, 100], palQ[#, 10] &], 2]], 90] (* Robert G. Wilson v, Jul 22 2015 *)

A341155 Number of partitions of n into 2 distinct nonzero decimal palindromes.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 3, 3, 2, 2, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 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
Offset: 3

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

A341191 Number of ways to write n as an ordered sum of 2 nonzero decimal palindromes.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 9, 8, 7, 6, 5, 4, 3, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 7, 2, 2
Offset: 2

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 90; CoefficientList[Series[Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]^2, {x, 0, nmax}], x] // Drop[#, 2] &

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 *)

A282584 Number of compositions (ordered partitions) of n into decimal palindromes (A002113).

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1022, 2042, 4081, 8156, 16300, 32576, 65104, 130112, 260032, 519681, 1038595, 2075660, 4148259, 8290402, 16568581, 33112734, 66176648, 132255728, 264316464, 528243231, 1055707644, 2109858797, 4216606912, 8426997041, 16841569684, 33658308890, 67266993433
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 19 2017

Keywords

Examples

			a(4) = 8 because we have [4], [3, 1], [2, 2], [2, 1, 1], [1, 3], [1, 2, 1], [1, 1, 2] and [1, 1, 1, 1].
		

Crossrefs

Programs

  • Mathematica
    nmax = 37; CoefficientList[Series[1/(1 - Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: 1/(1 - Sum_{k>=2} x^A002113(k)).

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

Views

Author

Ilya Gutkovskiy, Feb 19 2017

Keywords

Comments

Every number can be written as the sum of 3 palindromes (see A261132 and A261422).
Conjecture: a(n) > 0 for any sufficiently large n.
Additional conjecture: every number > 3 can be written as the sum of 4 squarefree palindromes.

Examples

			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].
		

Crossrefs

Programs

  • Mathematica
    nmax = 85; CoefficientList[Series[Sum[Boole[SquareFreeQ[k] && PalindromeQ[k]] x^k, {k, 1, nmax}]^3, {x, 0, nmax}], x]

Formula

G.f.: (Sum_{k>=1} x^A071251(k))^3.

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

Views

Author

Ilya Gutkovskiy, Feb 22 2017

Keywords

Comments

Is there k which satisfies a(n) > 0 for all n > k?

Examples

			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]
		

Crossrefs

Programs

  • Mathematica
    nmax = 55; CoefficientList[Series[(x + Sum[Boole[PrimePowerQ[k] && PalindromeQ[k]] x^k, {k, 1, nmax}])^6, {x, 0, nmax}], x]

Formula

G.f.: (Sum_{k>=1} x^A084092(k))^6.

A287961 Numbers that are the sum of two palindromic primes (A002385).

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 18, 22, 103, 104, 106, 108, 112, 133, 134, 136, 138, 142, 153, 154, 156, 158, 162, 183, 184, 186, 188, 192, 193, 194, 196, 198, 202, 232, 252, 262, 282, 292, 302, 312, 315, 316, 318, 320, 322, 324, 332, 342, 355, 356, 358, 360, 362, 364, 372, 375, 376, 378, 380
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 03 2017

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 380; f[x_] := Sum[Boole[PalindromeQ[k] && PrimeQ[k]] x^k, {k, 1, nmax}]^2; Exponent[#, x] & /@ List @@ Normal[Series[f[x], {x, 0, nmax}]]
Showing 1-10 of 11 results. Next