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

A084322 Fixed points if prime-factor-concatenation function (A084318) is iterated at primorial number initial values.

Original entry on oeis.org

2, 23, 547, 2357, 4359293547691, 325798243129564339, 3947306373286437248759663633906484193454376823
Offset: 1

Views

Author

Labos Elemer, Jun 20 2003

Keywords

Examples

			n=4: primorial[4]=2310; a(4)=4359293547691=A084318[2310]; the list of iterations:
{2310, 235711, 7151223, 34495309, 41841349, 1116722777, 1958774883, 313113444469, 744730492067, 4359293547691};
at each step the ordered prime factors of previous term are concatenated.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] q[x_] := Apply[Times, Table[Prime[w], {w, 1, x}]] lf[x_] := Length[FactorInteger[x]] nd[x_, y_] := 10*x+y tn[x_] := Fold[nd, 0, x] coc[x_] := Fold[nd, 0, Flatten[IntegerDigits[ba[x]], 1]] Table[FixedPoint[coc, q[w]], {w, 1, 7}]

Formula

a(n)=A084318[A002110(n)]

A037274 Home primes: for n >= 2, a(n) = the prime that is finally reached when you start with n, concatenate its prime factors (A037276) and repeat until a prime is reached (a(n) = -1 if no prime is ever reached).

Original entry on oeis.org

1, 2, 3, 211, 5, 23, 7, 3331113965338635107, 311, 773, 11, 223, 13, 13367, 1129, 31636373, 17, 233, 19, 3318308475676071413, 37, 211, 23, 331319, 773, 3251, 13367, 227, 29, 547, 31, 241271, 311, 31397, 1129, 71129, 37, 373, 313, 3314192745739, 41, 379, 43, 22815088913, 3411949, 223, 47, 6161791591356884791277
Offset: 1

Views

Author

Keywords

Comments

The initial 1 could have been omitted.
Probabilistic arguments give exactly zero for the chance that the sequence of integers starting at n contains no prime, the expected number of primes being given by a divergent sequence. - J. H. Conway
After over 100 iterations, a(49) is still composite - see A056938 for the latest information.
More terms:
a(50) to a(60) are 3517, 317, 2213, 53, 2333, 773, 37463, 1129, 229, 59, 35149;
a(61) to a(65) are 61, 31237, 337, 1272505013723, 1381321118321175157763339900357651;
a(66) to a(76) are 2311, 67, 3739, 33191, 257, 71, 1119179, 73, 379, 571, 333271.
This is different from A195264. Here 8 = 2^3 -> 222 -> ... -> 3331113965338635107 (a prime), whereas in A195264 8 = 2^3 -> 23 (a prime). - N. J. A. Sloane, Oct 12 2014

Examples

			9 = 3*3 -> 33 = 3*11 -> 311, prime, so a(9) = 311.
The trajectory of 8 is more interesting:
8 ->
2 * 2 * 2 ->
2 * 3 * 37 ->
3 * 19 * 41 ->
3 * 3 * 3 * 7 * 13 * 13 ->
3 * 11123771 ->
7 * 149 * 317 * 941 ->
229 * 31219729 ->
11 * 2084656339 ->
3 * 347 * 911 * 118189 ->
11 * 613 * 496501723 ->
97 * 130517 * 917327 ->
53 * 1832651281459 ->
3 * 3 * 3 * 11 * 139 * 653 * 3863 * 5107
and 3331113965338635107 is prime, so a(8) = 3331113965338635107.
		

References

  • Jeffrey Heleen, Family Numbers: Mathemagical Black Holes, Recreational and Educational Computing, 5:5, pp. 6, 1990.
  • Jeffrey Heleen, Family numbers: Constructing Primes by Prime Factor Splicing, J. Recreational Math., Vol. 28 #2, 1996-97, pp. 116-119.

Crossrefs

Cf. A195264 (use exponents instead of repeating primes).
Cf. A084318 (use only one copy of each prime), A248713 (Fermi-Dirac analog: use unique representation of n>1 as a product of distinct terms of A050376).
Cf. also A120716 and related sequences.

Programs

  • Maple
    b:= n-> parse(cat(sort(map(i-> i[1]$i[2], ifactors(n)[2]))[])):
    a:= n-> `if`(isprime(n) or n=1, n, a(b(n))):
    seq(a(n), n=1..48);  # Alois P. Heinz, Jan 09 2021
  • Mathematica
    f[n_] := FromDigits@ Flatten[ IntegerDigits@ Table[ #[[1]], { #[[2]] }] & /@ FactorInteger@n, 2]; g[n_] := NestWhile[ f@# &, n, !PrimeQ@# &]; g[1] = 1; Array[g, 41] (* Robert G. Wilson v, Sep 22 2007 *)
  • PARI
    step(n)=my(f=factor(n),s="");for(i=1,#f~,for(j=1,f[i,2],s=Str(s,f[i,1]))); eval(s)
    a(n)=if(n<4,return(n)); while(!isprime(n), n=step(n)); n \\ Charles R Greathouse IV, May 14 2015
    
  • Python
    from sympy import factorint, isprime
    def f(n): return int("".join(str(p)*e for p, e in factorint(n).items()))
    def a(n):
        if n == 1: return 1
        fn = n
        while not isprime(fn): fn = f(fn)
        return fn
    print([a(n) for n in range(1, 40)]) # Michael S. Branicky, Jul 11 2022
  • SageMath
    def digitLen(x,n):
        r=0
        while(x>0):
            x//=n
            r+=1
        return r
    def concatPf(x,n):
        r=0
        f=list(factor(x))
        for c in range(len(f)):
            for d in range(f[c][1]):
                r*=(n**digitLen(f[c][0],n))
                r+=f[c][0]
        return r
    def hp(x,n):
        x1=concatPf(x,n)
        while(x1!=x):
            x=x1
            x1=concatPf(x1,n)
        return x
    #example: prints the home prime of 8 in base 10
    print(hp(8,10))
    

Extensions

Corrected and extended by Karl W. Heuer, Sep 30 2003

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

A084317 Concatenation of the prime factors of n, in increasing order.

Original entry on oeis.org

0, 2, 3, 2, 5, 23, 7, 2, 3, 25, 11, 23, 13, 27, 35, 2, 17, 23, 19, 25, 37, 211, 23, 23, 5, 213, 3, 27, 29, 235, 31, 2, 311, 217, 57, 23, 37, 219, 313, 25, 41, 237, 43, 211, 35, 223, 47, 23, 7, 25, 317, 213, 53, 23, 511, 27, 319, 229, 59, 235, 61, 231, 37, 2, 513, 2311, 67
Offset: 1

Views

Author

Labos Elemer, Jun 16 2003

Keywords

Comments

Prime factor set of n is concatenated as follows:
1. factorize n;
2. order prime factors without exponents in order of magnitude;
3. concatenate digits to get a(n) as a decimal number.
The choice a(1)=0 is conventional; a(1)=1 would have been another possible choice. - M. F. Hasler, Oct 21 2014

Examples

			a(1) = 0 since 1 has no prime factors to concatenate.
n = 2520 = 2*2*2*3*3*5*7; prime factor set = {2,3,5,7}, so a(2520) = 2357.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= n-> parse(cat(`if`(n=1, 0, sort([factorset(n)[]])[]))):
    seq(a(n), n=1..100);  # Alois P. Heinz, Dec 06 2014
  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] lf[x_] := Length[FactorInteger[x]] nd[x_, y_] := 10*x+y tn[x_] := Fold[nd, 0, x] conc[x_] := Fold[nd, 0, Flatten[IntegerDigits[ba[x]], 1]] Table[conc[w], {w, 1, 128}]
    {0}~Join~Table[FromDigits@ Flatten@ IntegerDigits@ Map[First, FactorInteger@ n], {n, 2, 67}] (* Michael De Vlieger, May 02 2016 *)
  • PARI
    A084317(n)=if(n>1,eval(concat(apply(t->Str(t),factor(n)[,1]~)))) \\ Unfortunately up to PARI version 2.7.1 at least, "Str" cannot be applied as a closure (= function), but Str = Str() = "". - M. F. Hasler, Oct 22 2014

Formula

a(n) = a(squarefree kernel of n) = a(n^k) for any power k >= 1.

Extensions

Edited by M. F. Hasler, Oct 21 2014

A084319 Orbit of 91 under function described in A084317.

Original entry on oeis.org

91, 713, 2331, 3737, 37101, 383149, 1329473, 10912197, 328312853, 1129846623, 3735159117, 31245053039, 173977184859, 3293176308321, 319269241788861, 371325123869195203, 1278647733810375857, 1665622037676698019, 31742715741254857303, 56627509560552923867
Offset: 0

Views

Author

Labos Elemer, Jun 16 2003

Keywords

Comments

This sequence takes 64 steps to reach a prime (which implies A343156(91)=64). - N. J. A. Sloane, Apr 07 2021

Examples

			a(29) = 19797186041838357425713338412621, the 29th iterate.
		

References

  • Eric Angelini, W. Edwin Clark, Hans Havermann, Frank Stevenson, Allan C. Wechsler, and others, Postings to Math Fun mailing list, April 2021.

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits@ Flatten@ IntegerDigits@ Map[First, FactorInteger@ #] &, 91, 17] (* Michael De Vlieger, Mar 25 2017 *)

Extensions

Example corrected by Rémy Sigrist, Apr 07 2021

A085307 a(1) = 1; for n > 1, concatenate distinct prime factors of n in decreasing order.

Original entry on oeis.org

1, 2, 3, 2, 5, 32, 7, 2, 3, 52, 11, 32, 13, 72, 53, 2, 17, 32, 19, 52, 73, 112, 23, 32, 5, 132, 3, 72, 29, 532, 31, 2, 113, 172, 75, 32, 37, 192, 133, 52, 41, 732, 43, 112, 53, 232, 47, 32, 7, 52, 173, 132, 53, 32, 115, 72, 193, 292, 59, 532, 61, 312, 73, 2, 135, 1132, 67
Offset: 1

Views

Author

Labos Elemer, Jun 27 2003

Keywords

Comments

n and a(n) have the same parity.

Examples

			m = 100 = 2*2*5*5 -> {2,5} -> {5,2} -> 52 = a(100);
a(510510) = 1713117532, while A084317(510510) = 2357111317.
		

Crossrefs

In A084317 the order of factors is increasing.

Programs

  • Maple
    with(numtheory):
    a:= n-> parse(cat(`if`(n=1, 1, sort([factorset(n)[]], `>`)[]))):
    seq(a(n), n=1..100);  # Alois P. Heinz, May 02 2016
  • Mathematica
    f[n_] := FromDigits[ Flatten[ IntegerDigits /@ Reverse[ Flatten[ Table[ # [[1]], {1}] & /@ FactorInteger[n]]]]]; Table[ f[n], {n, 1, 70}]
    Table[FromDigits[Flatten[IntegerDigits/@Reverse[FactorInteger[n][[All, 1]]]]],{n,90}] (* Harvey P. Dale, Oct 10 2017 *)

Formula

Algorithm:
1. factorize n;
2. order prime factors by decreasing size;
3. concatenate prime factors and interpret the result as a decimal number.

Extensions

Edited by Robert G. Wilson v, Jul 15 2003

A209799 Composite numbers n such that the concatenation of the digits of the prime divisors of n is a prime number.

Original entry on oeis.org

4, 6, 8, 9, 12, 16, 18, 21, 22, 24, 25, 27, 32, 33, 36, 39, 44, 46, 48, 49, 51, 54, 58, 63, 64, 66, 70, 72, 81, 82, 88, 92, 93, 96, 99, 108, 111, 115, 116, 117, 121, 125, 128, 132, 133, 140, 141, 142, 144, 147, 153, 154, 159, 162, 164, 165, 166, 169, 176, 177
Offset: 1

Views

Author

Michel Lagneau, Mar 13 2012

Keywords

Examples

			70 is in the sequence because the prime divisors of 70 are {2,5,7} and 257 is prime.
		

Crossrefs

Programs

  • Maple
    read("transforms") ;
    isA209799 := proc(n)
        local pdivs ;
        if isprime(n) or n < 4 then
            return false;
        end if;
        pdivs := sort(convert(numtheory[factorset](n),list)) ;
        isprime(digcatL(pdivs)) ;
    end proc:
    for n from 4 to 200 do
            if isA209799(n) then printf("%d,",n) ;
            end if;
    end do: # R. J. Mathar, Mar 19 2012
  • Mathematica
    Select[Range[200],CompositeQ[#]&&PrimeQ[FromDigits[Flatten[ IntegerDigits/@ FactorInteger[#] [[;;,1]]]]]&] (* Harvey P. Dale, Apr 10 2023 *)

A248713 a(1)=1; starting with n>1, concatenate distinct divisors which are in A050376 in increasing order and repeat until a term of A050376 is reached (a(n)=0 if no term of A050376 is ever reached).

Original entry on oeis.org

1, 2, 3, 4, 5, 23, 7, 731173, 9, 25, 11, 31397, 13, 313, 1129, 16, 17, 29, 19, 59, 37, 211, 23, 731173, 25, 3251, 313, 47, 29, 547, 31, 313289, 311, 31397, 1129, 49, 37, 373, 313, 961, 41, 379, 43, 3137, 59, 223, 47, 479, 49, 71443, 317, 31123, 53, 239, 773
Offset: 1

Views

Author

Vladimir Shevelev, Oct 12 2014

Keywords

Comments

Fermi-Dirac analog of A037274 (terms of A050376 are Fermi-Dirac primes).

Examples

			We have 40 = 2*4*5 -> 245 = 5*49 -> 549 = 9*61 -> 961 is in A050376. So a(40) = 961.
		

Crossrefs

Extensions

a(8) and a(34) corrected by Hiroaki Yamanouchi, Oct 13 2014

A084323 Fixed points reached when prime-factor-concatenation function [A084317] is started at n!.

Original entry on oeis.org

0, 2, 23, 23, 547, 547, 2357, 2357, 2357, 2357, 4359293547691, 4359293547691, 325798243129564339, 325798243129564339, 325798243129564339, 325798243129564339, 3947306373286437248759663633906484193454376823
Offset: 1

Views

Author

Labos Elemer, Jun 20 2003

Keywords

Examples

			n=11: 11!=256.81.25.7.11; a(11)=iter[concatenate[{2,3,5,7,11}]] =A084318[39916800]; the list of iteration:
{39916800, 235711, 7151223, 34495309, 41841349, 1116722777, 1958774883, 313113444469, 744730492067, 4359293547691}
at each step the ordered prime factors of previous term are concatenated.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] q[x_] := Apply[Times, Table[Prime[w], {w, 1, x}]] lf[x_] := Length[FactorInteger[x]] nd[x_, y_] := 10*x+y tn[x_] := Fold[nd, 0, x] coc[x_] := Fold[nd, 0, Flatten[IntegerDigits[ba[x]], 1]] Table[FixedPoint[coc, q[w]], {w, 1, 7}]

Formula

a(n)=A084318[A000142(n)]=A084318[n! ]
Showing 1-9 of 9 results.