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.

A032789 Numbers k such that (k*(k+1)*(k+2)) / (k+(k+1)+(k+2)) is a palindrome.

Original entry on oeis.org

0, 1, 3, 4, 9, 21, 42, 99, 154, 237, 405, 999, 9999, 18991, 19291, 22021, 23587, 40293, 45072, 99999, 137652, 999999, 1278343, 1360456, 3162199, 3162499, 4029705, 4365396, 4418236, 6052891, 9999999, 31496589, 40289205, 41276535, 44295036, 56353251, 99999999
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

Equivalently, numbers k such that (2k + k^2)/3 is a palindrome. - Harvey P. Dale, Sep 02 2015
For all i >= 1, 9^i is a term with corresponding quotient 3^{2*i}, where ^ is repeated concatenation. - Michael S. Branicky, Jan 24 2022

Crossrefs

Programs

  • Mathematica
    palQ[n_]:=Module[{c=(2n+n^2)/3,id},id=If[IntegerQ[c],IntegerDigits[c],{1,2}];id==Reverse[id]]; Select[Range[0,10^7],palQ] (* Harvey P. Dale, Sep 02 2015 *)
  • Python
    from itertools import count, islice
    def ispal(n): s = str(n); return s == s[::-1]
    def agen():
        for k in count(0):
            q, r = divmod(k*(k+2), 3)
            if r == 0 and ispal(q):
                yield k, q
    print([k for k, q in islice(agen(), 31)]) # Michael S. Branicky, Jan 24 2022

Extensions

Definition clarified by Harvey P. Dale, Sep 02 2015
a(32) and beyond from Michael S. Branicky, Jan 24 2022