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.

A289667 Concatenate prime factorization written in base 3, convert back to decimal.

Original entry on oeis.org

1, 2, 3, 8, 5, 21, 7, 21, 11, 23, 11, 75, 13, 25, 32, 22, 17, 65, 19, 77, 34, 65, 23, 192, 17, 67, 30, 79, 29, 194, 31, 23, 92, 71, 52, 227, 37, 73, 94, 194, 41, 196, 43, 227, 104, 77, 47, 201, 23, 71, 98, 229, 53, 192, 146, 196, 100, 191, 59, 680, 61, 193, 106, 24
Offset: 1

Views

Author

N. J. A. Sloane, Jul 27 2017

Keywords

Comments

A080670 is the base 10 version, A230625 is the binary version.

Crossrefs

Programs

  • Maple
    # take ifsSorted from A080670
    A289667 := proc(n)
        local Ldgs, p,eb,pb,b ;
        b := 3;
        if n = 1 then
            return 1;
        end if;
        Ldgs := [] ;
        for p in ifsSorted(n) do
            pb := convert(op(1,p),base,b) ;
            Ldgs := [op(pb),op(Ldgs)] ;
            if op(2, p) > 1 then
                eb := convert(op(2,p),base,b) ;
                Ldgs := [op(eb),op(Ldgs)] ;
            end if;
        end do:
        add( op(e,Ldgs)*b^(e-1),e=1..nops(Ldgs)) ;
    end proc:
    seq(A289667(n),n=1..30) ; # R. J. Mathar, Aug 05 2017
  • Mathematica
    Table[FromDigits[#, 3] &@ Flatten@ Map[IntegerDigits[#, 3] &, FactorInteger[n] /. {p_, e_} /; p > 0 :> If[e == 1, p, {p, e}]], {n, 64}] (* Michael De Vlieger, Jul 29 2017 *)
  • PARI
    a(n) = {if (n==1, return(1)); f = factor(n); s = []; for (i=1, #f~, s = concat(s, digits(f[i, 1], 3)); if (f[i, 2] != 1, s = concat(s, digits(f[i, 2], 3))););  fromdigits(s, 3);} \\ Michel Marcus, Jul 27 2017

Extensions

More terms from Michel Marcus, Jul 27 2017