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.

Previous Showing 11-14 of 14 results.

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

A245270 Like A067599 but write everything in binary, then display the answer in base 10.

Original entry on oeis.org

5, 7, 10, 11, 47, 15, 11, 14, 91, 23, 87, 27, 95, 123, 20, 35, 94, 39, 171, 127, 183, 47, 95, 22, 187, 15, 175, 59, 763, 63, 21, 247, 355, 191, 174, 75, 359, 251, 187, 83, 767, 87, 343, 235, 367, 95, 167, 30, 182, 483, 347, 107, 95, 375, 191, 487, 379, 119
Offset: 2

Views

Author

Chai Wah Wu, Jul 15 2014

Keywords

Comments

The only fixed point < 10^8 is 470367 = 3^4 * 5807^1. - Christopher Scussel, Apr 28 2025

Examples

			24 = 2^3 * 3^1 has binary encoding 10_11_11_1, that is, 95 in decimal.
		

Crossrefs

Programs

  • PARI
    a(n) = {f = factor(n); s = []; for (i=1, #f~, s = concat(s, binary(f[i, 1])); s = concat(s, binary(f[i, 2]));); subst(Pol(s), x, 2);} \\ Michel Marcus, Jul 16 2014
  • Python
    import sympy
    [int(''.join([bin(y)[2:] for x in sorted(sympy.ntheory.factorint(n).items()) for y in x]),2) for n in range(2,200)] # compute a(n) for n > 1
    # Chai Wah Wu, Jul 15 2014
    

A384537 Composite numbers that are equal to the concatenation of the primes and exponents in their prime factorizations in some bases.

Original entry on oeis.org

16, 27, 64, 256, 729, 1024, 3125, 4096, 4617, 16384, 19683, 29767, 65536, 255987, 262144, 395847, 531441, 631463, 823543, 1048576, 1332331, 4194304, 9765625, 14348907, 16777216, 25640947, 67108864
Offset: 1

Views

Author

Jianing Song, Jun 02 2025

Keywords

Comments

Someone called James Davis found that 13532385396179 = 13 * 53^2 * 3853 * 96179, showing that a composite number can be equal the concatenation of the primes and exponents in its canonical prime factorization. In general, if a composite number is equal the concatenation in base b of the primes and exponents in its prime factorization, then let's call it a Davis number to base b.
Conjecture: a composite number can be a Davis number to at most one base.
Let (d_1,...,d_r) be the ordered tuple of prime factors and exponents > 1 in the prime factorization of n (e.g., 4617 = 3^5 * 19 -> (3,5,19), 13532385396179 = 13 * 53^2 * 3853 * 96179 -> (13,53,2,3853,96179)), then n is a Davis number to base b if and only if n = d_1*b^{s_1} + ... + d_{r-1}*b^{s_{r-1}} + d_r, where s_i = (Sum_{j=i+1..r} floor(log_b(d_j))) + r-i. In particular, we must have b dividing n - d_r.
Suppose that p^e is a Davis number to some base b, with e >= 2. We have p^e = p*b^(floor(log_b(e))+1) + e in base b, hence e is divisible by p. If b <= e, then we have p^e <= p*b^(log_b(e)+1) + e <= p*e^2 + e, which is impossible, and so we must have b > e. Conversely, when e is divisible by p and p^e > 4, p^e is a Davis number to base (p^e-e)/p > e.
No term can be squarefree: for primes p_1 < ... < p_r, the concatenation of p_1, ..., p_r in base b is p_1 * b^(Sum_{i=2..r} (floor(log_b(p_i))+1)) + ... >= p_1*...*p_r + ... > p_1*...*p_r.
Here are some examples that are near-miss of being Davis numbers to base 10. Each is equal to the concatenation of the factors and exponents in its generalized factorization (we call n = (q_1)^(e_1) * ... * (q_k)^(e_k) a generalized factorization of n, where 1 < q_1 < ... < q_k, (q_1,...,q_k) are pairwise coprime but are not necessarily primes, and exponents 1 are omitted; the number of such factorizations is A327399(n)):
2592 = 2^5 * 9^2;
34425 = 3^4 * 425;
312325 = 31^2 * 325;
492205 = 49^2 * 205;
36233196159122085048010973936921313644799483579440006455257 = 3^6 * 2331961591220850480109739369 * 21313644799483579440006455257. (Note that in the last four examples, we can add as many trailing zeros as we want).

Examples

			In base 6: 24 = 2^4 (in decimal: 16 = 2^4);
In base 8: 33 = 3^3 (in decimal: 27 = 3^3);
In base 29: 26 = 2^6 (in decimal: 64 = 2^6);
In base 124: 28 = 2^8 (in decimal: 256 = 2^8);
In base 241: 36 = 3^6 (in decimal: 729 = 3^6);
In base 507: 2A = 2^A (in decimal: 1024 = 2^10);
In base 624: 55 = 5^5 (in decimal: 3125 = 5^5);
In base 2042: 2C = 2^C (in decimal: 4096 = 2^12);
In base 11: 3518 = 3^5 * 18 (in decimal: 4617 = 3^5 * 19).
See A384540 for more nontrivial examples.
		

Crossrefs

Programs

  • PARI
    F(n,b) = my(f=factor(n), d=[]); for(i=1, #f~, d=concat(d, digits(f[i,1],b)); if(f[i,2]>1, d=concat(d, digits(f[i,2],b)))); fromdigits(d,b)
    isA384537(n) = {
    if(issquarefree(n), return(0)); my(f=factor(n), dr);
    if(#f~ == 1, return(n > 4 && f[1,2] % f[1,1] == 0));
    dr = if(f[#f~,2] == 1, f[#f~,1], f[#f~,2]);
    fordiv(n - dr, b, if(b>=2 && F(n,b)==n, return(b))); return(0);
    } \\ returns the (smallest) base to which n is a Davis number whenever possible

A384540 Numbers in A384537 that are not prime powers: composite numbers, not being prime powers, that are equal to the concatenation of the primes and exponents in their prime factorizations in some bases.

Original entry on oeis.org

4617, 29767, 255987, 395847, 631463, 1332331, 25640947
Offset: 1

Views

Author

Jianing Song, Jun 02 2025

Keywords

Comments

See A384537 for more information.

Examples

			In base 11: 3518 = 3^5 * 18 (in decimal: 4617 = 3^5 * 19);
In base 12: 15287 = 15^2 * 87 (in decimal: 29767 = 17^2 * 103);
In base 2: 111110011111110011 = 11^11 * 10011 * 111110011 (in decimal: 255987 = 3^3 * 19 * 499);
In base 362: (3,7,181)_362 = 3^7 * 181.
In base 300: (7,4,263)_300 = 7^4 * 263.
In base 57: 7B4D = 7 * B^4 * D (in decimal: 1332331 = 7 * 11^4 * 13).
In base 1228: (17,4,307)_1228 = 17^4*307.
		

Crossrefs

Programs

  • PARI
    F(n, b) = my(f=factor(n), d=[]); for(i=1, #f~, d=concat(d, digits(f[i, 1], b)); if(f[i, 2]>1, d=concat(d, digits(f[i, 2], b)))); fromdigits(d, b)
    isA384540(n) = {
    if(issquarefree(n), return(0)); my(f=factor(n), dr);
    if(#f~ == 1, return(0));
    dr = if(f[#f~, 2] == 1, f[#f~, 1], f[#f~, 2]);
    fordiv(n - dr, b, if(b>=2 && F(n, b)==n, return(b))); return(0);
    } \\ returns the (smallest) base to which n is a Davis number whenever possible
Previous Showing 11-14 of 14 results.