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

A039654 a(n) = prime reached by iterating f(x) = sigma(x)-1 starting at n, or -1 if no prime is ever reached.

Original entry on oeis.org

2, 3, 11, 5, 11, 7, 23, 71, 17, 11, 71, 13, 23, 23, 71, 17, 59, 19, 41, 31, 47, 23, 59, 71, 41, 71, 71, 29, 71, 31, 167, 47, 53, 47, 233, 37, 59, 71, 89, 41, 167, 43, 83, 167, 71, 47, 167, 167, 167, 71, 97, 53, 167, 71, 167, 79, 89, 59, 167, 61, 167, 103, 311, 83, 167, 67
Offset: 2

Views

Author

Keywords

Comments

It appears nearly certain that a prime is always reached for n>1.
Since sigma(n) > n for n > 1, and sigma(n) = n + 1 only for n prime, the iteration either reaches a prime and loops there, or grows indefinitely. - Franklin T. Adams-Watters, May 10 2010
Guy (2004) attributes this conjecture to Erdos. See Erdos et al. (1990). - N. J. A. Sloane, Aug 30 2017

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004. See Section B41, p. 149.

Crossrefs

Cf. A039655 (the number of steps needed), A039649, A039650, A039651, A039652, A039653, A039656, A291301, A291302, A291776, A291777.
For records see A292112, A292113.
Cf. A177343: number of times the n-th prime occurs in this sequence.
Cf. A292874: least k such that a(k) = prime(n).

Programs

Extensions

Contingency for no prime reached added by Franklin T. Adams-Watters, May 10 2010
Changed escape value from 0 to -1 to be consistent with several related sequences. - N. J. A. Sloane, Aug 31 2017

A291301 a(n) = prime that is eventually reached when x -> sigma(x)-1 is repeatedly applied to the product of the first n primes, or -1 if no prime is ever reached.

Original entry on oeis.org

2, 11, 71, 743, 6911, 117239, 2013983, 34836479, 921086711, 33596203871, 18754852859999, 1306753691335679, 2795529813471359, 200489563747397471, 7143750592470475271, 146095655504943513599, 161739770170976834876927, 543475838478389870591999, 317180662337566737324195839
Offset: 1

Views

Author

N. J. A. Sloane, Aug 31 2017

Keywords

Comments

A subsequence of A039654.

Examples

			2*3*5*7*11*13 = 30030 -> 96767 -> 111359 -> 117239 takes three steps to reach a prime, so a(6) = 117239.
		

Crossrefs

Cf. A039654, A000203, A002110, A291302 (number of steps).

Programs

  • Mathematica
    p[n_]:=Times@@Prime/@Range[n]; f[n_]:=DivisorSigma[1,n]-1;
    a[n_]:=Last[NestWhileList[f,p[n],CompositeQ]]; a/@Range[20] (* Ivan N. Ianakiev, Sep 01 2017 *)
  • Python
    from sympy import primorial, isprime, divisor_sigma
    def A291301(n):
        m = primorial(n)
        while not isprime(m):
            m = divisor_sigma(m) - 1
        return m # Chai Wah Wu, Aug 31 2017

Extensions

a(10)-a(19) from Chai Wah Wu, Aug 31 2017

A291776 a(n) = prime that is eventually reached when x -> sigma(x)-1 is repeatedly applied to 2^n-1, or -1 if no prime is ever reached.

Original entry on oeis.org

3, 7, 23, 31, 103, 127, 431, 911, 1847, 6719, 10487, 8191, 56999, 41399, 135647, 131071, 560159, 524287, 1999871, 3982271, 5909759, 17512991, 46092239, 46335599, 164460119, 186592247, 736727807, 3926707199, 4146049487, 2147483647, 8994904463, 11132323439
Offset: 2

Views

Author

N. J. A. Sloane, Aug 31 2017

Keywords

Examples

			For n=9, 2^n-1 = 511 with iterates 511->591->791->911, and 911 is the first prime, so a(7)=911.
		

Crossrefs

Programs

  • PARI
    P(x) = {for(c=0,10^6,if(isprime(x),return(x),x=sigma(x)-1));-1}
    vector(200,n,P(2^(n+1)-1)) \\ Lars Blomberg, Sep 01 2017

Extensions

Added a(7) and a(13)-a(33) from Lars Blomberg, Sep 01 2017

A291777 a(n) = number of steps to reach a prime when x -> sigma(x)-1 is repeatedly applied to 2^n-1, or -1 if no prime is ever reached.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 3, 2, 9, 2, 0, 7, 3, 4, 0, 2, 0, 1, 4, 1, 4, 2, 3, 4, 2, 12, 22, 8, 0, 3, 3, 4, 3, 1, 2, 2, 3, 3, 4, 3, 13, 2, 16, 3, 8, 3, 14, 17, 9, 37, 4, 7, 4, 7, 11, 4, 3, 14, 0, 14, 8, 1, 6, 8, 73, 26, 10, 1, 32, 6, 10, 2, 6, 2, 33, 2, 4, 52, 12, 16
Offset: 2

Views

Author

N. J. A. Sloane, Aug 31 2017

Keywords

Examples

			For n=9, 2^n-1 = 511 with iterates 511->591->791->911, and 911 is the first prime, so a(7)=3.
		

Crossrefs

Programs

  • PARI
    C(x) = {for(c=0,10^5,if(isprime(x),return(c),x=sigma(x)-1));-1}
    vector(200,n,C(2^(n+1)-1)) \\ Lars Blomberg, Sep 01 2017

Extensions

a(13)-a(82) from Lars Blomberg, Sep 01 2017
Showing 1-4 of 4 results.