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.

A246337 Numbers n which when expressed in base 16 are palindromes whose digit sum and digit product both divide n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 273, 69905, 78129, 200979, 17903889, 4581298449, 1172816597265, 1174959919377, 300240008712465, 300240176484625, 370608786444625
Offset: 1

Views

Author

Chai Wah Wu, Aug 22 2014

Keywords

Crossrefs

Programs

  • Python
    from operator import mul
    from functools import reduce
    from gmpy2 import t_mod, digits, mpz
    A246337 = sorted([mpz(n,16) for n in (digits(x,16)+digits(x,16)[::-1]
        for x in range(1,16**7)) if not (n.count('0') or
        t_mod(mpz(n,16), sum((mpz(d,16) for d in n)))
        or t_mod(mpz(n,16), reduce(mul,(mpz(d,16) for d in n))))] +
        [mpz(n,16) for n in (digits(x,16)+digits(x,16)[-2::-1]
        for x in range(16**7)) if not (n.count('0') or
        t_mod(mpz(n,16), sum((mpz(d,16) for d in n)))
        or t_mod(mpz(n,16), reduce(mul,(mpz(d,16) for d in n))))])