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

A262528 Maximum number of backward steps k needed to find a representation of an n-digit decimal number x as a sum of three base-10 palindromes of the form k-th largest base-10 palindrome <= x plus a number representable as sum of two base-10 palindromes from A260255.

Original entry on oeis.org

0, 1, 1, 3, 3, 11, 4, 10, 4, 23, 9, 15, 6, 23, 11
Offset: 1

Views

Author

Hugo Pfoertner, Sep 26 2015

Keywords

Comments

The sequence terms are counterexamples to the second part of the claim stated in the answers to the Math Magic Problem of the Month (June 1999) that "all sufficiently large numbers seem to be the sum of 3 palindromes, one of which is the biggest or second biggest possible", which would mean all a(k)=2 for k "sufficiently large".
Since exhaustive search is currently (2015) considered as not feasible, a(16)>=16, a(17)>=7, a(18)>=25, a(19)>=14 are only lower bounds for the next sequence terms.
M. Sigg has shown that a(n)>=3 for n = 5 + 4 * j.

Examples

			a(1)=0 because all 1-digit numbers are palindromes,
a(2)=a(3)=1 because all 2-digit and all 3-digit numbers can be represented by the nearest smaller palindrome and a number <=10, e.g., 201=191+9+1.
a(4)=3, because for the number 2023 the largest palindrome leading to a difference representable as sum of two palindromes is 1881. 2023-2002=21 and 2023-1991=32 are not in A260255. 2023-1881=142=141+1 is in A260255. No other 4-digit number requires more than 3 backward steps.
a(6)=11 because for the 6-digit number 101199 none of the first 10 differences 101199-101101=98, 101199-10001=1198, 101199-99999=1200, 101199-99899=1300, 101199-99799=1400, 101199-99699=1500, 101199-99599=1600, 101199-99499=1700, 101199-99399=1800, 101199-99299=1900 is representable as sum of two palindromes (i.e., are in A035137), whereas the 11th palindrome 99199 leads to 101199-99199=2000=1991+9.
a(18)>=25 because for the number x=100000001814566071 only the 25th palindrome < x 99999997779999999 produces the first difference 4034566072 representable as sum of 2 palindromes.
		

Crossrefs

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

A260254 Number of ways to write n as sum of two palindromes in decimal representation.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 21 2015

Keywords

Comments

a(A035137(n)) = 0; a(A260255(n)) > 0.

Examples

			.   n | a(n) |                                n | a(n) |
. ----+------+--------------------------    ----+------+--------------
.   0 |    1 |  0                            21 |    0 |  ./.
.   1 |    1 |  1                            22 |    2 |  22, 11+11
.   2 |    2 |  2, 1+1                       23 |    1 |  22+1
.   3 |    2 |  3, 2+1                       24 |    1 |  22+2
.   4 |    3 |  4, 3+1, 2+2                  25 |    1 |  22+3
.   5 |    3 |  5, 4+1, 3+2                  26 |    1 |  22+4
.   6 |    4 |  6, 5+1, 4+2, 3+3             27 |    1 |  22+5
.   7 |    4 |  7, 6+1, 5+2, 4+3             28 |    1 |  22+6
.   8 |    5 |  8, 7+1, 6+2, 5+3, 4+4        29 |    1 |  22+7
.   9 |    5 |  9, 8+1, 7+2, 6+3, 5+4        30 |    1 |  22+8
.  10 |    5 |  9+1, 8+2, 7+3, 6+4, 5+5      31 |    1 |  22+9
.  11 |    5 |  11, 9+2, 8+3, 7+4, 6+5       32 |    0 |  ./.
.  12 |    5 |  11+1, 9+3, 8+4, 7+5, 6+6     33 |    2 |  33, 22+11
.  13 |    4 |  11+2, 9+4, 8+5, 7+6          34 |    1 |  33+1
.  14 |    4 |  11+3, 9+5, 8+6, 7+7          35 |    1 |  33+2
.  15 |    3 |  11+4, 9+6, 8+7               36 |    1 |  33+3
.  16 |    3 |  11+5, 9+7, 8+8               37 |    1 |  33+4
.  17 |    2 |  11+6, 9+8                    38 |    1 |  33+5
.  18 |    2 |  11+7, 9+9                    39 |    1 |  33+6
.  19 |    1 |  11+8                         40 |    1 |  33+7
.  20 |    1 |  11+9                         41 |    1 |  33+8  .
		

Crossrefs

Programs

  • Haskell
    a260254 n = sum $ map (a136522 . (n -)) $
                   takeWhile (<= n `div` 2) a002113_list

Formula

a(n) = sum{A136522(n - A002113(k)): k = 1..floor(n/2)}.

A261675 Minimal number of palindromes in base 10 that add to n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 1, 2, 2, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, Sep 02 2015

Keywords

Comments

This sequence coincides with A088601 for n <= 301, but differs at n=302.
Although A088601 and this sequence agree for a large number of terms, because of their importance they warrant separate entries.
Cilleruelo and Luca prove that a(n) <= 3 (in fact they prove this for any fixed base g>=5). - Danny Rorabaugh, Feb 26 2016

Crossrefs

Programs

  • PARI
    ispal(n)=my(d=digits(n)); d==Vecrev(d);
    a(n)=my(L=n\2,d,e); if(ispal(n), return(1)); d=[1]; while((e=fromdigits(d))<=L, if(ispal(n-e), return(2)); my(k=#d,i=(k+1)\2); while(i&&d[i]==9, d[i]=0; d[k+1-i]=0; i--); if(i, d[i]++; d[k+1-i]=d[i], d=vector(#d+1); d[1]=d[#d]=1)); 3; \\ Charles R Greathouse IV, Nov 12 2018

A261906 Numbers that are the sum of two nonzero palindromes.

Original entry on oeis.org

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, 112, 113, 114, 115, 116, 117, 118, 119, 120
Offset: 1

Views

Author

N. J. A. Sloane, Sep 09 2015

Keywords

Comments

More than the usual number of terms are shown in order to distinguish this from A260255.

Examples

			22 is a member because it is the sum of two palindromes, 11+11 (not because it is a palindrome in its own right).
111 is not the sum of two nonzero palindromes, so appears in A260255 but not here. See A213879 for further differences between the two sequences.
		

Crossrefs

Programs

  • Maple
    # Sums of two nonzero pals:
    # bP has a list of palindromes starting at 0.
    a2:={}; M:=60; M2:=bP[M];
    for i from 2 to M do
    for j from i to M do
    k:=bP[i]+bP[j];
    if k <= M2 then a2:={op(a2),k}; fi;
    od: od:
    b2:=sort(convert(a2,list));
  • Mathematica
    Take[Total/@Tuples[Select[Range[200],PalindromeQ],2]//Union,120] (* Harvey P. Dale, Apr 27 2025 *)

A261907 Numbers that are the sum of two nonzero palindromes but are not palindromes themselves.

Original entry on oeis.org

10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 47, 48, 49, 50, 51, 52, 53, 56, 57, 58, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70, 71, 72, 73, 74, 75, 78, 79, 80, 81, 82, 83, 84, 85, 86, 89, 90, 91, 92, 93, 94, 95, 96, 97, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 112
Offset: 1

Views

Author

N. J. A. Sloane, Sep 09 2015

Keywords

Crossrefs

Equals A261906 \ A002113. Cf. A213879, A260255.

Programs

  • Maple
    # bP has a list of all palindromes (from A002113):
    a3:={}; M:=60; M2:=bP[M];
    for i from 2 to M do
    for j from i to M do
    k:=bP[i]+bP[j];
    if k <= M2 and digrev(k) <> k then a3:={op(a3),k}; fi;
    od: od:
    b3:=sort(convert(a3,list));

A213879 Positive palindromes that are not the sum of two positive palindromes.

Original entry on oeis.org

1, 111, 131, 141, 151, 161, 171, 181, 191, 1331, 1441, 1551, 1661, 1771, 1881, 1991, 10301, 10401, 10501, 10601, 10701, 10801, 10901, 11111, 11211, 11311, 11411, 11511, 11611, 11711, 11811, 11911, 12021, 12121, 12321, 12421, 12521, 12621, 12721, 12821
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jun 23 2012

Keywords

Comments

These numbers do not occur in A035137.

Examples

			22 is not a member because 22 = 11 + 11.
		

Crossrefs

Programs

  • Maple
    # From N. J. A. Sloane, Sep 09 2015: bP is a list of the palindromes
    a:={}; M:=400; for n from 3 to M do p:=bP[n];
    # is p a sum of two palindromes?
    sw:=-1; for i from 2 to n-1 do j:=p-bP[i]; if digrev(j)=j then sw:=1; break; fi;
    od;
    if sw<0 then a:={op(a),p}; fi; od:
    b:=sort(convert(a,list));
  • Mathematica
    lst1 = {}; lst2 = {}; r = 12821; Do[If[FromDigits@Reverse@IntegerDigits[n] == n, AppendTo[lst1, n]], {n, r}]; l = Length[lst1]; Do[s = lst1[[i]] + lst1[[j]]; AppendTo[lst2, s], {i, l - 1}, {j, i}]; Complement[lst1, lst2]
    palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t1 = Select[Range[12900], palQ[#] &]; Complement[t1, Union[Flatten[Table[i + j, {i, t1}, {j, t1}]]]] (* Jayanta Basu, Jun 15 2013 *)

Formula

({ A002113 } intersect { A319477 }) minus { 0 }. - Alois P. Heinz, Sep 19 2018

A318535 Integers a(n) such that [a(n) - k] is a palindrome in base 10, with k <10.

Original entry on oeis.org

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
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 28 2018

Keywords

Comments

This is not the sequence A260255 although more than the first 111 terms are equal.

Examples

			21 is not in the sequence because 11 (the closest palindromic integer < 21) is not reachable by subtracting an integer < 10 from 21. The integers 32, 43 or 2018 are not in the sequence for the same reason.
		

Crossrefs

Cf. A318536 for an equivalent sequence [addition of (k < 10) instead of subtraction].
Cf. A261906.

A263994 First element of first run of at least n consecutive numbers not representable as the sum of two base-10 palindromes.

Original entry on oeis.org

21, 1041, 1051, 1061, 1071, 1081, 1091, 107209, 108429, 109803, 10715097, 10854691, 10904639, 10904731, 10904731, 10904731, 10904731, 10983831, 11002311, 11002311, 11002311, 1078112970, 1078122970
Offset: 1

Views

Author

Hugo Pfoertner, Oct 31 2015

Keywords

Comments

First occurrence of n consecutive numbers in A035137.

Examples

			a(2)=1041 because 1041 and 1042 are the first two consecutive numbers in A035137.
		

Crossrefs

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