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-7 of 7 results.

A230625 Concatenate prime factorization written in binary, convert back to decimal.

Original entry on oeis.org

1, 2, 3, 10, 5, 11, 7, 11, 14, 21, 11, 43, 13, 23, 29, 20, 17, 46, 19, 85, 31, 43, 23, 47, 22, 45, 15, 87, 29, 93, 31, 21, 59, 81, 47, 174, 37, 83, 61, 93, 41, 95, 43, 171, 117, 87, 47, 83, 30, 86, 113, 173, 53, 47, 91, 95, 115, 93, 59, 349, 61, 95, 119, 22
Offset: 1

Views

Author

N. J. A. Sloane, Oct 27 2013

Keywords

Comments

As in A080670 the prime factorization is written as p1^e1*...*pN^eN (except for exponents eK = 1 which are omitted), with all factors and exponents in binary (cf. A007088). Then "^" and "*" signs are dropped, all binary digits are concatenated, and the result is converted back to decimal (base 10). - M. F. Hasler, Jun 21 2017
The first nontrivial fixed point of this function is 255987. Smaller numbers such that a(a(n)) = n are 1007, 1269; 1503, 3751. See A230627 for further information. - M. F. Hasler, Jun 21 2017
255987 is the only nontrivial fixed point less than 10000000. - Benjamin Knight, May 16 2018

Examples

			6 = 2*3 = (in binary) 10*11 -> 1011 = 11 in base 10, so a(6) = 11.
20 = 2^2*5 = (in binary) 10^10*101 -> 1010101 = 85 in base 10, so a(20) = 85.
		

Crossrefs

See A289667 for the base 3 version.
See A291803 for partial sums.

Programs

  • Maple
    # take ifsSorted from A080670
    A230625 := proc(n)
        local Ldgs, p,eb,pb,b ;
        b := 2;
        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(A230625(n),n=1..30) ; # R. J. Mathar, Aug 05 2017
  • Mathematica
    Table[FromDigits[#, 2] &@ Flatten@ Map[IntegerDigits[#, 2] &, FactorInteger[n] /. {p_, 1} :> {p}], {n, 64}] (* Michael De Vlieger, Jun 23 2017 *)
  • PARI
    a(n) = {if (n==1, return(1)); f = factor(n); s = []; for (i=1, #f~, s = concat(s, binary(f[i, 1])); if (f[i, 2] != 1, s = concat(s, binary(f[i, 2])));); subst(Pol(s), x, 2);} \\ Michel Marcus, Jul 15 2014
    
  • PARI
    A230625(n)=n>1||return(1);fold((x,y)->if(y>1,x<M. F. Hasler, Jun 21 2017
  • Python
    import sympy
    [int(''.join([bin(y)[2:] for x in sorted(sympy.ntheory.factorint(n).items()) for y in x if y != 1]),2) for n in range(2,100)] # compute a(n) for n > 1
    # Chai Wah Wu, Jul 15 2014
    

Extensions

More terms from Chai Wah Wu, Jul 15 2014
Added self-contained definition. - M. F. Hasler, Jun 21 2017

A230627 Prime reached in A230626, or -1 if no prime is reached.

Original entry on oeis.org

2, 3, 31, 5, 11, 7, 11, 23, 31, 11, 43, 13, 23, 29, 251, 17, 23, 19, 251, 31, 43, 23, 47, 43, 463, 29, 23, 29, 127, 31, 31, 59, 23, 47, 8093, 37, 83, 61, 127, 41, 179, 43, 467, 463, 23, 47, 83, 127, 467, 113, 173, 53, 47, 23, 179, 241, 127, 59, 349, 61, 179
Offset: 2

Views

Author

N. J. A. Sloane, Oct 27 2013

Keywords

Comments

David J. Seal found that the number 255987 is fixed by the map described in A230625 (or equally A287874), so a(255987) = -1. - N. J. A. Sloane, Jun 15 2017
I also observe that the numbers 1007 and 1269 are mapped to each other by that map, as are the numbers 1503 and 3751 (see the b-file submitted by Chai Wah Wu for A230625). So a(1007) = a(1269) = a(1503) = a(3751) = -1. - David J. Seal, Jun 16 2017
a(217) = a(255) = a(446) = a(558) = a(717) = a(735) = a(775) = a(945) = a(958) = -1 since the trajectory either converges to (1007,1269) or to (1503,3751). - Chai Wah Wu, Jun 16 2017
See A287878 for the trajectory of 234. - N. J. A. Sloane, Jun 17 2017
See A288894 for the trajectory of 3932. - Sean A. Irvine, Jun 18 2017
The latest information seems to be that for numbers less than 12388, all trajectories either end at a fixed point or in a cycle of length 2. - N. J. A. Sloane, Jul 27 2017

Crossrefs

Base-2 analog to A195264.
See A287875 for these same numbers written in binary.
See A288847 for where the values -1 occur.

Programs

  • Mathematica
    fn[n_] := FromDigits[Flatten[IntegerDigits[ReplaceAll[FactorInteger[n], {x_, 1} -> {x}], 2]], 2];
    Table[NestWhile[fn, n, # != 1 && ! PrimeQ[#] &], {n, 2, 50}] (* Robert Price, Mar 16 2020 *)

Extensions

More terms from Chai Wah Wu, Jul 15 2014
Changed the "escape" value from 0 to -1 to be consistent with A195264. - N. J. A. Sloane, Jul 27 2017

A230626 Iterate the map x -> A230625(x) starting at n; sequence gives number of steps to reach a prime, or -1 if no prime is ever reached.

Original entry on oeis.org

0, 0, 3, 0, 1, 0, 1, 2, 2, 0, 1, 0, 1, 1, 4, 0, 4, 0, 3, 1, 1, 0, 1, 2, 4, 2, 3, 0, 2, 0, 2, 1, 5, 1, 7, 0, 1, 1, 2, 0, 2, 0, 2, 3, 3, 0, 1, 3, 3, 1, 1, 0, 1, 3, 2, 6, 2, 0, 1, 0, 2, 2, 2, 2, 3, 0, 1, 2, 6, 0, 2, 0, 4, 4, 3, 2, 2, 0, 4, 4, 3, 0, 5, 2, 2, 2, 3
Offset: 2

Views

Author

N. J. A. Sloane, Oct 27 2013

Keywords

Comments

David J. Seal found that the number 255987 is fixed by the map described in A230625 (or equally A287874), so a(255987) = -1. - N. J. A. Sloane, Jun 15 2017
I also observe that the numbers 1007 and 1269 are mapped to each other by that map, as are the numbers 1503 and 3751 (see the b-file submitted by Chai Wah Wu for A230625). So a(1007) = a(1269) = a(1503) = a(3751) = -1. - David J. Seal, Jun 16 2017
a(217) = a(255) = a(446) = a(558) = a(717) = a(735) = a(775) = a(945) = a(958) = -1 since the trajectory either converges to (1007,1269) or to (1503,3751). 255987 has several preimages, e.g. a(7^25*31^19) = a(3^28*7^7*19) = a(7^12*31^51) = -1. a(3568) = 74 ending in the prime 318792605899852268194734519209581. - Chai Wah Wu, Jun 16 2017
See A287878 for the trajectory of 234, which ends at a prime at step 103. - N. J. A. Sloane, Jun 18 2017
See A288894 for the trajectory of 3932. - Sean A. Irvine, Jun 18 2017

Examples

			Starting at 18: 18 = 2*3^2 = 10*11^10 in binary -> 101110 = 46 = 2*23 = 10*10111 -> 1010111 = 87 = 3*29 = 11*11101 -> 1111101 = 125 = 5^3 = 101^11 -> 10111 = 23, prime, taking 4 steps, so a(18) = 4.
		

Crossrefs

Programs

  • Mathematica
    fn[n_] := FromDigits[Flatten[IntegerDigits[ReplaceAll[FactorInteger[n], {x_, 1} -> {x}], 2]], 2];
    Map[Length, Table[NestWhileList[fn, n, # != 1 && ! PrimeQ[#] &], {n, 2, 40}], {1}] - 1 (* Robert Price, Mar 16 2020 *)

Extensions

More terms from Chai Wah Wu, Jul 15 2014

A287874 Concatenate prime factorization as in A080670, but write everything in binary.

Original entry on oeis.org

1, 10, 11, 1010, 101, 1011, 111, 1011, 1110, 10101, 1011, 101011, 1101, 10111, 11101, 10100, 10001, 101110, 10011, 1010101, 11111, 101011, 10111, 101111, 10110, 101101, 1111, 1010111, 11101, 1011101, 11111, 10101, 111011, 1010001, 101111, 10101110, 100101
Offset: 1

Views

Author

N. J. A. Sloane, Jun 15 2017

Keywords

Comments

As in A080670 the prime factorization of n is written as p1^e1*...*pN^eN (except for exponents eK = 1 which are omitted), with all factors and exponents in binary (cf. A007088). Then "^" and "*" signs are dropped and all binary digits are concatenated.
See A230625 for the terms written in base 10, and for further information (fixed points, trajectories).

Examples

			a(1) = 1 by convention.
a(2) = 10 (= 2 written in binary).
a(4) = 1010 = concatenate(10,10), since 4 = 2^2 = 10[2] ^ 10[2].
a(6) = 1011 = concatenate(10,11), since 6 = 2*3 = 10[2] * 11[2].
a(8) = 1011 = concatenate(10,11), since 8 = 2^3 = 10[2] ^ 11[2].
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local F, L, i;
        F:= map(op,subs(1=NULL, sort(ifactors(n)[2], (a,b) -> a[1] < b[1])));
        F:= map(convert, F, binary);
        L:= map(length,F);
        L:= ListTools:-Reverse(ListTools:-PartialSums(ListTools:-Reverse(L)));
        add(F[i]*10^L[i+1],i=1..nops(F)-1)+F[-1];
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Jun 20 2017
  • Mathematica
    fn[1] = 1; fn[n_] := FromDigits[Flatten[IntegerDigits[DeleteCases[Flatten[FactorInteger[n]], 1], 2]]];
    Table[fn[n], {n, 37}] (* Robert Price, Mar 16 2020 *)
  • PARI
    A287874(n)=if(n>1,fromdigits(concat(apply(binary,select(t->t>1,concat(Col(factor(n))~)))),10),1) \\ M. F. Hasler, Jun 21 2017
    
  • Python
    from sympy import factorint
    def a(n):
        f=factorint(n)
        return 1 if n==1 else int("".join(bin(i)[2:] + bin(f[i])[2:] if f[i]!=1 else bin(i)[2:] for i in f))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 23 2017

Formula

a(n) = A007088(A230625(n)). - R. J. Mathar, Jun 16 2017

Extensions

Edited by M. F. Hasler, Jun 21 2017

A287878 Trajectory of 234 under the map x -> A230625(x).

Original entry on oeis.org

234, 749, 1003, 1147, 2021, 2799, 7479, 7957, 9453, 30601, 36783, 122563, 246885, 978327, 3926821, 5159983, 9838787, 16121775, 62223239, 113838307, 775077957, 1043973167, 2519959611, 8311144305, 31830468841
Offset: 1

Views

Author

N. J. A. Sloane, Jun 17 2017

Keywords

Comments

Thanks to the work of Chai Wah Wu, it is known that all numbers less than 234 have trajectories that end either at a fixed point or in a cycle of length 2. David J. Seal and Sean A. Irvine have also studied these trajectories. See A230625, A230626, A230627 for the latest information.
For numbers less than 12388, all trajectories either end at a fixed point or in a cycle of length 2.

Crossrefs

A288894 Trajectory of 3932 under the map x -> A230625(x).

Original entry on oeis.org

3932, 11223, 30571, 40521, 125967, 247763, 341915, 779817, 1897841, 6074935, 12439665, 123673573, 158531777, 248736245, 779730449, 4713421981, 6575471649, 4270067827, 5040914531, 1592591247, 2126855121, 3959133009, 16523140695
Offset: 1

Views

Author

Sean A. Irvine, Jun 18 2017

Keywords

Crossrefs

A288847 Numbers whose trajectories under the map x -> A230625(x) never reach a prime.

Original entry on oeis.org

217, 255, 446, 558, 717, 735, 775, 945, 958, 1007, 1062, 1115, 1269, 1344, 1503, 1984, 2215, 2358, 3003, 3751, 3858, 4131, 4471, 5144, 6174, 6627, 6915, 6923, 7033, 7073, 7139, 7434, 7530, 7778, 8125, 8142, 8239, 8335, 8575, 8967, 9186, 9303, 10040, 10179, 10856, 11907, 12081, 12248
Offset: 1

Views

Author

David J. Seal, Jun 18 2017

Keywords

Comments

Sequence suggested by N. J. A. Sloane on the SeqFan mailing list. These are also the numbers n for which A230626(n) = -1 and A230627(n) = A287875(n) = 0. All currently-listed terms (those <= 3858) enter one of the two loops 1007 <-> 1269 and 1503 <-> 3751.
Further values added (Jun 19 2017) based on Sean A. Irvine's extension of the b-file for A230626.

Examples

			217, 255, 945, 1007 and 1269 are in the sequence because under the map x -> A230625(x):
217 = 7*31 = binary 111*11111 -> binary 11111111 = 255
255 = 3*5*17 = binary 11*101*10001 -> binary 1110110001 = 945
945 = 3^3*5*7 = binary 11^11*101*111 -> binary 1111101111 = 1007
1007 = 19*53 = binary 10011*110101 -> binary 10011110101 = 1269
1269 = 3^3*47 = binary 11^11*101111 -> binary 1111101111 = 1007
		

Crossrefs

Extensions

a(43)-a(48) from Chai Wah Wu, Jul 13 2017
Showing 1-7 of 7 results.