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

A195264 Iterate x -> A080670(x) (replace x with the concatenation of the primes and exponents in its prime factorization) starting at n until reach 1 or a prime (which is then the value of a(n)); or a(n) = -1 if a prime is never reached.

Original entry on oeis.org

1, 2, 3, 211, 5, 23, 7, 23, 2213, 2213, 11, 223, 13, 311, 1129, 233, 17, 17137, 19
Offset: 1

Views

Author

N. J. A. Sloane, Sep 14 2011, based on discussions on the Sequence Fans Mailing List by Alonso del Arte, Franklin T. Adams-Watters, D. S. McNeil, Charles R Greathouse IV, Sean A. Irvine, and others

Keywords

Comments

J. H. Conway offered $1000 for a proof or disproof for his conjecture that every number eventually reaches a 1 or a prime - see OEIS50 link. - N. J. A. Sloane, Oct 15 2014
However, James Davis has discovered that a(13532385396179) = -1. This number D = 13532385396179 = (1407*10^5+1)*96179 = 13*53^2*3853*96179 is clearly fixed by the map x -> A080670(x), and so never reaches 1 or a prime. - Hans Havermann, Jun 05 2017
The number n = 3^6 * 2331961591220850480109739369 * 21313644799483579440006455257 is a near-miss for another nonprime fixed point. Unfortunately here the last two factors only look like primes (they have no prime divisors < 10), but in fact both are composite. - Robert Gerbicz, Jun 07 2017
The number D' = 13^532385396179 maps to D and so is a much larger number with a(D') = -1. Repeating this process (by finding a prime prefix of D') should lead to an infinite sequence of counterexamples to Conway's conjecture. - Hans Havermann, Jun 09 2017
The first 47 digits of D' form a prime P = 68971066936841703995076128866117893410448319579, so if Q denotes the remaining digits of 13^532385396179 then D'' = P^Q is another counterexample. - Robert Gerbicz, Jun 10 2017
This sequence is different from A037274. Here 8 = 2^3 -> 23 (a prime), whereas in A037274 8 = 2^3 -> 222 -> ... -> 3331113965338635107 (a prime). - N. J. A. Sloane, Oct 12 2014
The value of a(20) is presently unknown (see A195265).

Examples

			4 = 2^2 -> 22 =2*11 -> 211, prime, so a(4) = 211.
9 = 3^2 -> 32 = 2^5 -> 25 = 5^2 -> 52 = 2^2*13 -> 2213, prime, so a(9)=2213.
		

Crossrefs

A variant of the home primes, A037271. Cf. A080670, A195265 (trajectory of 20), A195266 (trajectory of 105), A230305, A084318. A230627 (base-2), A290329 (base-3)

Programs

  • Mathematica
    f[1] := 1; f[n_] := Block[{p = Flatten[FactorInteger[n]]}, k = Length[p]; While[k > 0, If[p[[k]] == 1, p = Delete[p, k]]; k--]; FromDigits[Flatten[IntegerDigits[p]]]]; Table[FixedPoint[f, n], {n, 19}] (* Alonso del Arte, based on the program for A080670, Sep 14 2011 *)
    fn[n_] := FromDigits[Flatten[IntegerDigits[DeleteCases[Flatten[
    FactorInteger[n]], 1]]]];
    Table[NestWhile[fn, n, # != 1 && ! PrimeQ[#] &], {n, 19}] (* Robert Price, Mar 15 2020 *)
  • PARI
    a(n)={n>1 && while(!ispseudoprime(n), n=A080670(n));n} \\ M. F. Hasler, Oct 12 2014

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

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

A287875 Iterate the map x -> A230625(x) starting at n; sequence gives the first prime (or 1) that is reached, written in base 2, or -1 if no prime is ever reached.

Original entry on oeis.org

1, 10, 11, 11111, 101, 1011, 111, 1011, 10111, 11111, 1011, 101011, 1101, 10111, 11101, 11111011, 10001, 10111, 10011, 11111011, 11111, 101011, 10111, 101111, 101011, 111001111, 11101, 10111, 11101, 1111111, 11111, 11111, 111011, 10111, 101111, 1111110011101, 100101
Offset: 1

Views

Author

N. J. A. Sloane, Jun 15 2017

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. (In fact 255987 is the smallest composite number that is fixed.) - N. J. A. Sloane, Jun 15 2017
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 they are smaller composite values with a(n) = -1, though not fixed. - 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

Crossrefs

Cf. A230625, A230626, A230627 (where the primes reached are written in base 10).

Programs

  • Mathematica
    Table[FromDigits@ IntegerDigits[#, 2] &@ If[n == 1, 1, NestWhile[FromDigits[#, 2] &@ Flatten@ Map[IntegerDigits[#, 2] &, FactorInteger[#] /. {p_, 1} :> {p}] &, n, ! PrimeQ@ # &, {2, 1}]], {n, 37}] (* Michael De Vlieger, Jun 24 2017 *)

Extensions

Changed the "escape" value from 0 to -1 to be consistent with A195264. - N. J. A. Sloane, Jul 27 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

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

A290329 Iterate the map x -> A289667(x) starting at n; sequence gives primes reached, or -1 if no prime is ever reached.

Original entry on oeis.org

2, 3, 71, 5, 71, 7, 71, 11, 23, 11, 5261, 13, 17, 23, 703455573449, 17, 703455573449, 19, 5261, 71, 703455573449, 23, 727, 17, 67, 21544131687786037881228990839860266551231, 79, 29, 21544131687786037881228990839860266551231, 31, 23, 239, 71, 229, 227, 37, 73
Offset: 2

Views

Author

Chai Wah Wu, Jul 27 2017

Keywords

Comments

Base 3 analog of A195264 and A230627.

Crossrefs

Programs

  • Maple
    A290329 := proc(n)
        local nitr ;
        nitr := n ;
        while ( not isprime(nitr) and nitr <> 1) do
            nitr := A289667(nitr) ;
        end do:
        return nitr ;
    end proc:
    seq(A290329(n),n=1..20) ; # R. J. Mathar, Aug 05 2017
  • Mathematica
    Table[NestWhile[FromDigits[#, 3] &@ Flatten@ Map[IntegerDigits[#, 3] &, FactorInteger[#] /. {p_, e_} /; p > 0 :> If[e == 1, p, {p, e}]] &, n, ! PrimeQ@ # &], {n, 2, 38}] (* Michael De Vlieger, Jul 29 2017 *)

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