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.

A208665 Numbers that match odd ternary polynomials; see Comments.

Original entry on oeis.org

3, 6, 27, 30, 33, 54, 57, 60, 243, 246, 249, 270, 273, 276, 297, 300, 303, 486, 489, 492, 513, 516, 519, 540, 543, 546, 2187, 2190, 2193, 2214, 2217, 2220, 2241, 2244, 2247, 2430, 2433, 2436, 2457, 2460, 2463, 2484, 2487, 2490, 2673, 2676, 2679
Offset: 1

Views

Author

Clark Kimberling, Feb 29 2012

Keywords

Comments

The ternary polynomials (having all coefficients in {0,1,2}) are enumerated at A207966. This sequence shows the numbers n for which p(n,-x)=-p(n,x).

Crossrefs

Cf. A037314, A207966, A338086 (ternary digit duplication).

Programs

  • Mathematica
    t = Table[IntegerDigits[n, 3], {n, 1, 4000}];
    b[n_] := Reverse[Table[x^k, {k, 0, n}]]
    p[n_, x_] := t[[n]].b[-1 + Length[t[[n]]]]
    Table[p[n, x], {n, 1, 30}]
    even = {}; Do[n++; If[(p[n, x] /. x -> -x) == p[n, x], AppendTo[even, n]], {n, 1600}];
    even     (* A037314 for n >= 2 *)
    odd = {}; Do[n++; If[(p[n, x] /. x -> -x) == -p[n, x], AppendTo[odd, n]], {n, 3900}];
    odd      (* A208665 *)
  • PARI
    a(n) = 3*fromdigits(digits(n,3),9); \\ Kevin Ryde, Oct 17 2020