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.

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

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

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.

A319586 Number of n-digit base-10 palindromes (A002113) that cannot be written as the sum of two positive base-10 palindromes.

Original entry on oeis.org

2, 0, 8, 7, 95, 94, 975, 971, 9810, 9805, 98288, 98272
Offset: 1

Views

Author

Hugo Pfoertner, Sep 23 2018

Keywords

Examples

			a(1) = 2, because 0 and 1 are not sums of two positive 1-digit integers, all of which are palindromes. a(3) = 8, because the 8 3-digit palindromes 111, 131, 141, 151, 161, 171, 181, and 191 (A213879(2) ... A213879(9)) cannot be written as sum of two nonzero palindromes.
		

Crossrefs

Programs

  • PARI
    \\ calculates a(2)...a(8) using M. F. Hasler's functions in A002113
    A002113(n)={my(L=logint(n,10));(n-=L=10^max(L-(n<11*10^(L-1)), 0))*L+fromdigits(Vecrev(digits(if(nA002113(n)={Vecrev(n=digits(n))==n}
    inv_A002113(P)={P\(P=10^(logint(P+!P, 10)\/2))+P}
    for(i=1,8,j=0;for(m=inv_A002113(10^i+1),inv_A002113(2*(10^i+1)),P=A002113(m);issum=0;for(k=2,m,PP=A002113(k);if(PP>P/2,break);if(is_A002113(P-PP),issum=1;break));if(issum==0,j++));print1(j,", ",))
    
  • Python
    from sympy import isprime
    from itertools import product
    def pals(d, base=10): # all d-digit palindromes
        digits = "".join(str(i) for i in range(base))
        for p in product(digits, repeat=d//2):
            if d > 1 and p[0] == "0": continue
            left = "".join(p); right = left[::-1]
            for mid in [[""], digits][d%2]: yield int(left + mid + right)
    def a(n):
        palslst = [p for d in range(1, n+1) for p in pals(d)][1:]
        palsset = set(palslst)
        cs = ctot = 0
        for p in pals(n):
            ctot += 1
            for p1 in palslst:
                if p - p1 in palsset: cs += 1; break
                if p1 > p//2: break
        return ctot - cs
    print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Jul 12 2021

Extensions

a(12) from Giovanni Resta, Oct 01 2018
Showing 1-5 of 5 results.