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-5 of 5 results.

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

A329544 Add the odd terms and subtract the even ones, the result must always be a palindrome. This is the lexicographically earliest sequence of distinct positive integers with this property.

Original entry on oeis.org

1, 3, 2, 5, 4, 19, 11, 22, 6, 17, 14, 8, 7, 15, 16, 27, 24, 13, 18, 29, 26, 37, 33, 44, 28, 39, 36, 25, 30, 41, 38, 49, 46, 35, 40, 51, 48, 59, 45, 10, 68, 32, 21, 20, 9, 55, 58, 47, 50, 61, 60, 71, 66, 77, 23, 12, 88, 191, 101, 111, 91, 112, 31, 81, 121, 131, 141, 70, 132, 80, 122, 90, 142, 174, 43, 54, 72, 83, 53, 42
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 16 2019

Keywords

Comments

Negative palindromes are not allowed (0 is OK). After 50000 terms, the smallest unused integers are 919, 1020, 1029, 1031, 1038, 1041, 1047, ... and the largest used is 208831. The largest palindrome produced so far is 1000001. Is the sequence a permutation of the integers > 0?
After one million terms, the smallest unused integers are still the seven mentioned (above) for 50000 terms. - Hans Havermann, Nov 27 2019
This sequence is not a permutation of the nonnegative integers because it cannot contain any term of A104444. The value 919 may only appear after a running total equal to 0 (see A083142, A084843). - Rémy Sigrist, Dec 11 2019. There are only two 0's in the first million terms of A329796, at n=12 and n=1002, so the chance that this happens seems slight. On the other hand, the zeros in the base 3 analog, A330314, are more plentiful (see A330325), so further investigation is needed. - Hans Havermann and N. J. A. Sloane, Dec 12 2019

Examples

			The sequence starts with 1 which is positive and a palindrome.
1 + 3 = 4 (palindrome). (2 is not allowed because 1 - 2 < 0.)
1 + 3 - 2 = 2 (palindrome)
1 + 3 - 2 + 5 = 7 (palindrome)
1 + 3 - 2 + 5 - 4 = 3 (palindrome)
1 + 3 - 2 + 5 - 4 + 19 = 22 (palindrome)
1 + 3 - 2 + 5 - 4 + 19 + 11 = 33 (palindrome)
1 + 3 - 2 + 5 - 4 + 19 + 11 - 22 = 11 (palindrome), etc.
		

Crossrefs

Cf. A329545 (same idea, but where the odd integers are subtracted and the even ones are added).
Cf. A002113 (palindromes), A086862 (first differences), A104444, A329796 (running totals), A329797, A329798 (records), A330311 (when n appears).

Programs

  • PARI
    A329544_vec(N,u=1,U,a,s,d)={vector(N,n, a=u; while(bittest(U,a-u)|| Vecrev(d=digits(s-(-1)^a*a))!=d|| (a>s&&!bittest(a,0)),a++); s-=(-1)^a*a; U+=1<<(a-u); while(bittest(U,0), U>>=1; u++);a)} \\ M. F. Hasler, Nov 16 2019

A084843 Numbers n such that no palindrome m > 0 exists with n + m also a palindrome.

Original entry on oeis.org

919, 1020, 1029, 1031, 1038, 1041, 1047, 1051, 1061, 1065, 1071, 1074, 1081, 1091, 1101, 1130, 1131, 1139, 1141, 1148, 1151, 1157, 1161, 1171, 1175, 1181, 1191, 1201, 1231, 1240, 1241, 1249, 1251, 1258, 1261, 1267, 1271, 1281, 1291, 1301, 1314, 1341
Offset: 1

Views

Author

Patrick De Geest, Jun 08 2003

Keywords

Examples

			There is no palindrome x > 0 such that x + 919 (itself coincidentally also palindromic) is a palindrome.
		

Crossrefs

A330311 Where n appears in A329544, or -1 if n never appears.

Original entry on oeis.org

1, 3, 2, 5, 4, 9, 13, 12, 45, 40, 7, 56, 18, 11, 14, 15, 10, 19, 6, 44, 43, 8, 55, 17, 28, 21, 16, 25, 20, 29, 63, 42, 23, 175, 34, 27, 22, 31, 26, 35, 30, 80, 75, 24, 39, 33, 48, 37, 32, 49, 36, 85, 79, 76, 46, 187, 130, 47, 38, 51, 50, 89, 84, 110, 109
Offset: 1

Views

Author

N. J. A. Sloane, Dec 10 2019

Keywords

Comments

a(919) is unknown. If it is not -1, it is greater than 10^6 (see A329544).

Crossrefs

Formula

a(A104444(n)) = -1. - Rémy Sigrist, Dec 11 2019

A329545 After a(1) = 1, add the even terms and subtract the odd ones, the result must always be a palindrome. This is the lexicographically earliest sequence of distinct positive integers with this property.

Original entry on oeis.org

1, 2, 3, 4, 18, 11, 5, 16, 13, 7, 6, 14, 15, 26, 22, 33, 17, 28, 25, 36, 35, 9, 8, 58, 55, 44, 46, 10, 20, 30, 73, 77, 66, 24, 40, 50, 103, 79, 68, 34, 23, 81, 48, 47, 80, 83, 72, 54, 43, 85, 52, 49, 38, 37, 70, 64, 53, 87, 32, 27, 60, 57, 90, 12, 45, 59, 92, 42, 75, 61, 94, 62, 95, 63, 74, 69, 194
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 16 2019

Keywords

Comments

Negative palindromes are not allowed. After 50000 terms, the smallest unused integers are 964, 1020, 1029, 1031, 1038, 1041, 1047, 1051, ... and the largest used is 173410. The largest palindrome produced so far is 309903. Is the sequence a permutation of the integers > 0?
a(63411) = 964. Rémy Sigrist's comment in A329544 shows that terms in A104444 are not in the sequence. Conjecture: Sequence is a permutation of positive integers not in A104444. - Chai Wah Wu, Dec 11 2019

Examples

			The sequence starts with 1, smallest positive integer.
1 + 2 = 3 (palindrome)
1 + 2 - 3 = 0 (palindrome)
1 + 2 - 3 + 4 = 1 (palindrome)
1 + 2 - 3 + 4 + 18 = 22 (palindrome)
1 + 2 - 3 + 4 + 18 - 11 = 11 (palindrome)
1 + 2 - 3 + 4 + 18 - 11 - 5 = 6 (palindrome)
1 + 2 - 3 + 4 + 18 - 11 - 5 + 16 = 22 (palindrome), etc.
		

Crossrefs

Cf. A329544 (same idea, but where the odd integers are added and the even ones are subtracted).
Cf. A002113 (palindromes), A086862 (first differences of palindromes).
Cf. A104444.

Programs

  • PARI
    A329545_vec(N, u=1, U, a, s=2, d)={vector(N, n, a=u; while(bittest(U, a-u)|| Vecrev(d=digits(s+(-1)^a*a))!=d|| (a>s&&bittest(a, 0)), a++); s+=(-1)^a*a; U+=1<<(a-u); while(bittest(U, 0), U>>=1; u++); a)} \\ M. F. Hasler, Nov 16 2019
Showing 1-5 of 5 results.