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

A249156 Palindromic in bases 5 and 7.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 24, 57, 78, 114, 342, 624, 856, 1432, 10308, 12654, 27616, 100056, 537856, 593836, 769621, 1434168, 1473368, 1636104, 1823544, 1862744, 17968646, 18108296, 22412057, 34713713, 34853363, 39280254, 159690408, 663706192
Offset: 1

Views

Author

Ray Chandler, Oct 27 2014

Keywords

Comments

Intersection of A029952 and A029954.

Examples

			114 is a term since 114 = 424 base 5 and 114 = 222 base 7.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer,base_Integer]:=Block[{idn=IntegerDigits[n,base]},idn==Reverse[idn]];Select[Range[10^6]-1,palQ[#,5]&&palQ[#,7]&]
  • PARI
    isok(n) = my(df = digits(n, 5), ds = digits(n, 7)); (Vecrev(df)==df) && (Vecrev(ds)==ds); \\ Michel Marcus, Oct 31 2017
  • Python
    from gmpy2 import digits
    def palQ(n,b): # check if n is a palindrome in base b
        s = digits(n,b)
        return s == s[::-1]
    def palQgen(l,b): # unordered generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,b**l):
                s = digits(x,b)
                yield int(s+s[-2::-1],b)
                yield int(s+s[::-1],b)
    A249156_list = sorted([n for n in palQgen(8,5) if palQ(n,7)]) # Chai Wah Wu, Nov 25 2014
    

A249155 Palindromic in bases 6 and 15.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 14, 80, 160, 301, 602, 693, 994, 1295, 1627, 1777, 2365, 2666, 5296, 5776, 6256, 17360, 34720, 51301, 52201, 105092, 155493, 209284, 587846, 735644, 7904800, 11495701, 80005507, 80469907, 83165017, 89731777, 90196177
Offset: 1

Views

Author

Ray Chandler, Oct 27 2014

Keywords

Comments

Intersection of A029953 and A029960.

Examples

			301 is a term since 301 = 1221 base 6 and 301 = 151 base 15.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; Select[Range[10^6] - 1, palQ[#, 6] && palQ[#, 15] &]
  • Python
    from gmpy2 import digits
    def palQ(n, b): # check if n is a palindrome in base b
        s = digits(n, b)
        return s == s[::-1]
    def palQgen(l, b): # generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1, l+1):
                for y in range(b**(x-1), b**x):
                    s = digits(y, b)
                    yield int(s+s[-2::-1], b)
                for y in range(b**(x-1), b**x):
                    s = digits(y, b)
                    yield int(s+s[::-1], b)
    A249155_list = [n for n in palQgen(8, 6) if palQ(n, 15)] # Chai Wah Wu, Nov 29 2014

A249158 Palindromic in bases 7 and 29.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 16, 24, 150, 300, 5952, 7752, 7955, 9755, 9958, 11904, 13704, 13907, 14110, 15707, 15910, 392850, 751043, 4585544, 12737804, 12828748, 16380296, 19289406, 19380350, 20228253, 33115710, 395849700, 1339182534
Offset: 1

Views

Author

Ray Chandler, Oct 27 2014

Keywords

Examples

			150 is a term since 150 = 303 base 7 and 150 = 55 base 27.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer,base_Integer]:=Block[{idn=IntegerDigits[n,base]},idn==Reverse[idn]];Select[Range[10^6]-1,palQ[#,7]&&palQ[#,29]&]
  • Python
    from gmpy2 import digits
    def palQ(n, b): # check if n is a palindrome in base b
        s = digits(n, b)
        return s == s[::-1]
    def palQgen(l, b): # unordered generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1, b**l):
                s = digits(x, b)
                yield int(s+s[-2::-1], b)
                yield int(s+s[::-1], b)
    A249158_list = sorted([n for n in palQgen(8,7) if palQ(n,29)])
    # Chai Wah Wu, Nov 25 2014
Showing 1-3 of 3 results.