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.

A250410 Numbers palindromic in bases 10 and 25.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 494, 626, 676, 1001, 6886, 7887, 8338, 9339, 622226, 626626, 2828282, 2859582, 3304033, 3309033, 3330333, 3335333, 3361633, 3366633, 3392933, 3397933, 6603066, 6608066, 6634366, 6639366, 8986898, 9400049, 9405049, 9431349, 9436349, 9462649, 9467649, 9493949, 9498949
Offset: 1

Views

Author

Robert G. Wilson v, Nov 22 2014

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n) eq Reverse(Intseq(n))and Intseq(n, 25) eq Reverse(Intseq(n, 25))]; // Vincenzo Librandi, Nov 23 2014
    
  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; genPal[n_] := Block[{id = IntegerDigits@ n, insert = {{}, {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; k = 1; lst = {0, 1, 2, 3,  4, 5, 6, 7, 8, 9}; While[k < 1000001, s = Select[ genPal[k], palQ[#, 25] &]; If[s != {}, AppendTo[lst, s]; Print@ s; lst = Sort@ Flatten@ lst]; k++]; lst
  • 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 palQgen10(l): # unordered generator of palindromes of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,10**l):
                s = str(x)
                yield int(s+s[-2::-1])
                yield int(s+s[::-1])
    A250410_list = sorted([n for n in palQgen10(6) if palQ(n,25)])
    # Chai Wah Wu, Nov 25 2014