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-20 of 27 results. Next

A037276 Start with 1; for n>1, replace n with the concatenation of its prime factors in increasing order.

Original entry on oeis.org

1, 2, 3, 22, 5, 23, 7, 222, 33, 25, 11, 223, 13, 27, 35, 2222, 17, 233, 19, 225, 37, 211, 23, 2223, 55, 213, 333, 227, 29, 235, 31, 22222, 311, 217, 57, 2233, 37, 219, 313, 2225, 41, 237, 43, 2211, 335, 223, 47, 22223, 77, 255, 317, 2213, 53, 2333
Offset: 1

Views

Author

Keywords

Examples

			If n = 2^3*5^5*11^2 = 3025000, a(n) = 222555551111 (n=2*2*2*5*5*5*5*5*11*11, then remove the multiplication signs).
		

Crossrefs

Cf. A037274, A048985, A067599, A080670, A084796. Different from A073646.
Cf. also A027746, A289660 (a(n)-n).

Programs

  • Haskell
    a037276 = read . concatMap show . a027746_row
    -- Reinhard Zumkeller, Apr 03 2012
    
  • Maple
    # This is for n>1
    read("transforms") ;
    A037276 := proc(n)
        local L,p ;
        L := [] ;
        for p in ifactors(n)[2] do
            L := [op(L),seq(op(1,p),i=1..op(2,p))] ;
        end do:
        digcatL(L) ;
    end proc: # R. J. Mathar, Oct 29 2012
  • Mathematica
    co[n_, k_] := Nest[Flatten[IntegerDigits[{#, n}]] &, n, k - 1]; Table[FromDigits[Flatten[IntegerDigits[co @@@ FactorInteger[n]]]], {n, 54}] (* Jayanta Basu, Jul 04 2013 *)
    FromDigits@ Flatten@ IntegerDigits[Table[#1, {#2}] & @@@ FactorInteger@ #] & /@ Range@ 54 (* Michael De Vlieger, Jul 14 2015 *)
  • PARI
    a(n)={ n<4 & return(n); for(i=1,#n=factor(n)~, n[1,i]=concat(vector(n[2,i],j,Str(n[1,i])))); eval(concat(n[1,]))}  \\ M. F. Hasler, Jun 19 2011
    
  • Python
    from sympy import factorint
    def a(n):
        f=factorint(n)
        l=sorted(f)
        return 1 if n==1 else int("".join(str(i)*f[i] for i in l))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 23 2017

A067599 Decimal encoding of the prime factorization of n: concatenation of prime factors and exponents.

Original entry on oeis.org

21, 31, 22, 51, 2131, 71, 23, 32, 2151, 111, 2231, 131, 2171, 3151, 24, 171, 2132, 191, 2251, 3171, 21111, 231, 2331, 52, 21131, 33, 2271, 291, 213151, 311, 25, 31111, 21171, 5171, 2232, 371, 21191, 31131, 2351, 411, 213171, 431, 22111, 3251, 21231
Offset: 2

Views

Author

Joseph L. Pe, Jan 31 2002

Keywords

Comments

If n has prime factorization p_1^e_1 * ... * p_r^e_r with p_1 < ... < p_r, then its decimal encoding is p_1 e_1...p_r e_r. For example, 15 = 3^1 * 5^1, so has decimal encoding 3151.
Sequence A068633 is a duplicate, up to a conventional initial term a(1)=11.
a(31) = a(177147) = 311. Is there any solution to a(n) = n? - Franklin T. Adams-Watters, Dec 18 2006
The earliest duplicate is a(223) = 2231 = a(12). There is no fixed point below 3*10^6. - M. F. Hasler, Oct 06 2013

Examples

			The prime factorization of 24 = 2^3 * 3^1 has corresponding encoding 2331. So a(24) = 2331.
a(42) = 213171 since 42 = 2^1*3^1*7^1. - _Amarnath Murthy_, Feb 27 2002
		

Crossrefs

Programs

  • Haskell
    import Data.Function (on)
    a067599 n = read $ foldl1 (++) $
       zipWith ((++) `on` show) (a027748_row n) (a124010_row n) :: Integer
    -- Reinhard Zumkeller, Oct 27 2013
  • Maple
    with(ListTools): with(MmaTranslator[Mma]): seq(FromDigits(FlattenOnce(ifactors(n)[2])), n=2..46); # Wolfdieter Lang, Aug 16 2014
    # second Maple program:
    a:= n-> parse(cat(map(i-> i[], sort(ifactors(n)[2]))[])):
    seq(a(n), n=2..60);  # Alois P. Heinz, Mar 16 2018
  • Mathematica
    f[n_] := FromDigits[ Flatten[ IntegerDigits[ FactorInteger[ n]]]]; Table[ f[n], {n, 2, 50} ]
  • PARI
    A067599(n)=eval(concat(concat([""],concat(Vec(factor(n)~))~))) \\ - M. F. Hasler, Oct 06 2013
    

Extensions

Edited by Robert G. Wilson v, Feb 02 2002
Merged contributions from A068633 to here, and minor edits by M. F. Hasler, Oct 06 2013

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

A288818 Number of ways in which one can insert * and ^ into the decimal digits of n to create a valid (see comments) base-ten factorization statement.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 3, 1, 2, 1, 2, 1, 2, 0, 1, 1, 1, 1, 2, 1, 3, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 1, 2, 1, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2, 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Hans Havermann, Jun 17 2017

Keywords

Comments

A base-ten factorization statement is valid when it is the product of base-ten powers of (left to right) strictly increasing base-ten primes. A single prime (with or without an exponent) is acceptable. No prime and no exponent may begin with a zero. No exponent may be equal to one.
Excepting 1, a(n) is the number of occurrences of n in A080670.

Examples

			a(12) = 0 because there are no valid solutions.
a(1111) = 1 because 11^11 is the only valid statement.
a(7013) = 2 because 7013 and 701^3 are the only solutions.
a(2353797) = 75 because there are 75 valid solutions.
a(13^532*3853*96179) = 1593300019. There are 1593300019 ways of creating valid factorization statements using this 602-digit integer.
		

Crossrefs

Cf. A288819 (records), A288820 (records' position), A080670.

Programs

  • Mathematica
    See the StackExchange link. (* or *)
    ric[d_, lp_] := Block[{p, e, i, j, n = Length@d}, If[n == 0, cnt++, If[d[[1]] > 0, Do[p = FromDigits@ Take[d, i]; If[p > lp && PrimeQ@p, ric[Take[d, i - n], p]; Do[e = Take[d, {i + 1, j}]; If[e[[1]] > 0 && e != {1}, ric[Take[d, j - n], p]], {j, i+1, n}]], {i, n}]]]]; a[n_] := (cnt = 0; ric[ IntegerDigits@ n, 1]; cnt); Array[a, 100] (* Giovanni Resta, Jun 19 2017 *)

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

A080695 Concatenation of the prime power factors (with maximal exponent) of n; a(1) = 1 by convention.

Original entry on oeis.org

1, 2, 3, 4, 5, 23, 7, 8, 9, 25, 11, 43, 13, 27, 35, 16, 17, 29, 19, 45, 37, 211, 23, 83, 25, 213, 27, 47, 29, 235, 31, 32, 311, 217, 57, 49, 37, 219, 313, 85, 41, 237, 43, 411, 95, 223, 47, 163, 49, 225, 317, 413, 53, 227, 511, 87, 319, 229, 59, 435, 61, 231, 97, 64
Offset: 1

Views

Author

Vladeta Jovovic, Mar 03 2003

Keywords

Comments

a(n) = n iff n is 1 or a prime power; otherwise, a(n) > n. - Ivan Neretin, May 31 2016

Examples

			a(67500) = a(2^2*3^3*5^4) = a(4*27*625) = 427625.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits@Flatten@IntegerDigits[#[[1]]^#[[2]] & /@ FactorInteger[n]], {n, 64}] (* Ivan Neretin, May 31 2016 *)

Extensions

Edited by Charles R Greathouse IV, Apr 29 2010

A288820 Indices of records in A288818.

Original entry on oeis.org

1, 2, 23, 223, 233, 237, 2237, 2337, 22337, 23137, 23337, 23373, 23797, 223373, 223797, 231373, 233137, 233797, 2233797, 2313797, 2331373, 2333797, 2337379, 2337397, 2353797, 22353797, 22373797, 23137397, 23173797, 23313797, 23353797, 23373797
Offset: 1

Views

Author

Hans Havermann, Jun 17 2017

Keywords

Comments

If one assumes that larger terms begin with 22 or 23, then a(54)-a(64) are: 223373733797, 223537373797, 231337373797, 231353673797, 231353733797, 231373733797, 233137337397, 233537373797, 233753733797, 235313733797, and 235373733797. - Hans Havermann, Jul 31 2017

Crossrefs

Cf. A288818, A288819 (records' value), A080670.

Programs

  • Mathematica
    ric[d_, lp_] := Block[{p, e, i, j, n = Length@d}, If[n == 0, cnt++, If[d[[1]] > 0, Do[p = FromDigits@ Take[d, i]; If[p > lp && PrimeQ@p, ric[Take[d, i - n], p]; Do[e = Take[d, {i + 1, j}]; If[e[[1]] > 0 && e != {1}, ric[Take[d, j - n], p]], {j, i+1, n}]], {i, n}]]]]; a[n_] := (cnt = 0; ric[ IntegerDigits@ n, 1]; cnt); L = {1}; k = 1; bst = 0; While[Length@L < 18, v = a[++k]; If[v > bst, AppendTo[L, k]; bst = v]]; L (* Giovanni Resta, Jun 19 2017 *)

A288819 Record maxima in A288818.

Original entry on oeis.org

0, 1, 3, 4, 5, 6, 8, 12, 13, 17, 18, 21, 22, 23, 25, 30, 34, 41, 45, 54, 58, 60, 62, 66, 75, 80, 82, 83, 88, 104, 110, 124, 131, 147, 163, 166, 173, 194, 220, 228, 233, 257, 290, 313, 334, 350, 359, 365, 412, 468, 477, 503, 520
Offset: 1

Views

Author

Hans Havermann, Jun 17 2017

Keywords

Comments

If one assumes that larger records occur at A288818 indices beginning with 22 or 23, then a(54)-a(64) are: 528, 534, 538, 542, 636, 657, 687, 728, 764, 768, and 847. - Hans Havermann, Jul 31 2017

Crossrefs

Cf. A288818, A288820 (records' position), A080670.

Programs

  • Mathematica
    ric[d_, lp_] := Block[{p, e, i, j, n = Length@d}, If[n == 0, cnt++, If[d[[1]] > 0, Do[p = FromDigits@ Take[d, i]; If[p > lp && PrimeQ@p, ric[Take[d, i - n], p]; Do[e = Take[d, {i + 1, j}]; If[e[[1]] > 0 && e != {1}, ric[Take[d, j - n], p]], {j, i+1, n}]], {i, n}]]]]; a[n_] := (cnt = 0; ric[ IntegerDigits@ n, 1]; cnt); Union@ FoldList[Max, Array[a, 10^6]] (* Michael De Vlieger, Jun 19 2017, after Giovanni Resta at A288818 *)

Extensions

a(46)-a(53) from Giovanni Resta, Jun 20 2017

A289660 a(n) = A037276(n) - n.

Original entry on oeis.org

0, 0, 0, 18, 0, 17, 0, 214, 24, 15, 0, 211, 0, 13, 20, 2206, 0, 215, 0, 205, 16, 189, 0, 2199, 30, 187, 306, 199, 0, 205, 0, 22190, 278, 183, 22, 2197, 0, 181, 274, 2185, 0, 195, 0, 2167, 290, 177, 0, 22175, 28, 205, 266, 2161, 0, 2279, 456, 2171, 262, 171, 0, 2175, 0, 169, 274, 222158, 448, 2245, 0
Offset: 1

Views

Author

N. J. A. Sloane, Jul 24 2017

Keywords

Comments

The fact that a(n)>0 if n is composite shows that (unlike A080670), A037276 has no nontrivial fixed points (nor any cycles).

Crossrefs

Programs

  • Mathematica
    FromDigits@Flatten@IntegerDigits[Table[#1,{#2}]&@@@FactorInteger@#]-#&/@Range@54 (* Vincenzo Librandi, Jul 25 2017 *)
  • Python
    from sympy import factorint
    def A289660(n):
        return 0 if n == 1 else int(''.join(map(lambda x: str(x[0])*x[1],sorted(factorint(n).items())))) - n # Chai Wah Wu, Jul 25 2017
Previous Showing 11-20 of 27 results. Next