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.

Showing 1-2 of 2 results.

A008468 a(n) = n OR n^3 (applied to binary expansions).

Original entry on oeis.org

1, 10, 27, 68, 125, 222, 343, 520, 729, 1002, 1339, 1740, 2205, 2750, 3375, 4112, 4913, 5850, 6875, 8020, 9277, 10654, 12183, 13848, 15641, 17594, 19707, 21980, 24413, 27006, 29791, 32800, 35937, 39338, 42875, 46692, 50685, 54910, 59319, 64040
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [BitwiseOr(n,n^3): n in [1..40]]; // Bruno Berselli, Mar 30 2018
  • Maple
    a:= n-> Bits[Or](n, n^3):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 29 2018
  • Mathematica
    (* program should not be used to extend this sequence *)
    d=16; Mb=Array[ 2^(d-#)&, d ]; Map[ Plus@@(Mb*#)&, Array[ IntegerDigits[ #, 2, d ]+IntegerDigits[ #^3, 2, d ]&, 40 ]/. (2->1) ]
    f[n_]:=BitOr[n, n^3]; Array[f, 10000, 1] (* Vincenzo Librandi, Mar 30 2018 *)
  • PARI
    a(n) = bitor(n, n^3); \\ Michel Marcus, Mar 30 2018
    

A008469 a(n) = n OR n^3 (applied to ternary expansions).

Original entry on oeis.org

1, 8, 30, 67, 125, 222, 349, 512, 738, 1009, 1340, 1740, 2200, 2744, 3390, 4102, 4913, 5850, 6877, 8018, 9282, 10660, 12176, 13848, 15631, 17576, 19710, 21979, 24416, 27003, 29794, 32768, 35943, 39337, 42902, 46692, 50662, 54881, 59331, 64030, 68921
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local g, h, i, r;
          g, h, r:= n, n^3, 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=12; Mb=Array[ b^(d-#)&, d ]; Map[ Plus@@(Mb*#)&, Array[ Max /@ Transpose[ {IntegerDigits[ #, b, d ], IntegerDigits[ #^3, b, d ]} ]&, 80 ] ]
Showing 1-2 of 2 results.