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.

A130139 Let f denote the map that replaces k with the concatenation of its nontrivial divisors, written in increasing order, each divisor being written in base 10 in the normal way. Then a(n) = prime reached when starting at 2n+1 and iterating f.

Original entry on oeis.org

1, 3, 5, 7, 3, 11, 13, 1129, 17, 19, 37, 23, 5, 313, 29, 31, 311, 1129, 37, 313, 41, 43
Offset: 0

Views

Author

N. J. A. Sloane, Jul 30 2007

Keywords

Comments

If 2n+1 is 1 or a prime, set a(n) = 2n+1. If no prime is ever reached, set a(n) = -1.

Examples

			n = 7: 2n+1 = 15 = 3*5 -> 35 = 5*7 -> 57 = 3*19 -> 319 = 11*29 -> 1129, prime, so a(7) = 1129.
		

Crossrefs

Cf. A037279, A130140, A130141, A130142. A bisection of A120716.

Programs

  • Python
    from sympy import divisors, isprime
    def f(n): return int("".join(str(d) for d in divisors(n)[1:-1]))
    def a(n):
        if n == 0: return 1
        fn, c = 2*n + 1, 0
        while not isprime(fn):
            fn, c = f(fn), c+1
        return fn
    print([a(n) for n in range(22)]) # Michael S. Branicky, Jul 11 2022

Extensions

Name edited by Michel Marcus, Mar 09 2023