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.

A008467 a(n) = n OR n^2 (applied to ternary expansions).

Original entry on oeis.org

1, 5, 12, 16, 26, 42, 52, 71, 90, 100, 122, 147, 178, 206, 231, 259, 296, 342, 370, 401, 453, 484, 539, 591, 646, 701, 756, 784, 842, 930, 961, 1025, 1095, 1186, 1259, 1332, 1369, 1445, 1524, 1609, 1691, 1770, 1852, 1943, 2070, 2152, 2237, 2316, 2401, 2510
Offset: 1

Views

Author

Keywords

Comments

OR(a, b) = max(a, b) for ternary digits a and b. - Sean A. Irvine, Mar 29 2018

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local g, h, i, r;
          g, h, r:= n, n^2, 0; for i from 0 while h>0 do
          r:= r + 3^i * max(irem(g, 3, 'g'), irem(h, 3, 'h')) od; r
        end:
    seq(a(n), n=1..140);  # Alois P. Heinz, Mar 29 2018
  • Mathematica
    (* program should not be used to extend this sequence *)
    b=3; d=9; Mb=Array[ b^(d-#)&, d ]; Map[ Plus@@(Mb*#)&, Array[ Max /@ Transpose[ {IntegerDigits[ #, b, d ], IntegerDigits[ #^2, b, d ]} ]&, 140 ] ]