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

A120716 a(1)=1, a(p)=p if p is a prime. Otherwise, start with n and iterate the map (k -> concatenation of nontrivial divisors of k) until we reach a prime q; then a(n) = q. If we never reach a prime, a(n) = -1.

Original entry on oeis.org

1, 2, 3, 2, 5, 23, 7
Offset: 1

Views

Author

N. J. A. Sloane, Jul 19 2007

Keywords

Comments

a(8) is currently unknown.
The sequence continues from a(8)-a(100): >10^50, 3, 5, 11, >10^50, 13, 313, 1129, >10^50, 17, >10^50, 19, >10^50, 37, 211, 23, >10^50, 5, 3251, 313, >10^50, 29, >10^50, 31, >10^50, 311, >10^50, 1129, >10^50, 37, 373, 313, >10^50, 41, >10^50, 43, >10^50, >10^50, 223, 47, >10^50, 7, >10^50, 317, >10^50, 53, 23691827, 773, >10^50, 1129, 229, 59, >10^50, 61, >10^50, 378593, >10^50, >10^5", >10^50, 67, >10^50, 39191573, >10^50, 71, >10^50, 73, 379, >10^50, >10^50, 3979237, 236132639, 79, >10^50, >10^50, 241, 83, >10^50, 3137, >10^50, 3983249, >10^50, 89, >10^50, >10^50, >10^50, 331, 1319, 36389, >10^50, 97, >10^50, 391133, >10^50. - Robert Price, Mar 27 2019

Examples

			4 -> 2, prime, so a(4) = 2.
6 -> 2,3 -> 23, prime, so a(6) = 23.
8 -> 2,4 -> 24 -> 2,3,4,6,8,12 -> 2346812 -> 2,4,13,26,52,45131,90262,180524,586703,1173406 -> 2413265245131902621805245867031173406 -> ? (see link for the continuation)
9 -> 3, prime, so a(9) = 3.
21 -> 3,7 -> 37, prime, so a(21) = 37.
		

Crossrefs

Programs

  • Mathematica
    A120716[n_] := Module[{x},
       If[n == 1, Return[1]];
       If[PrimeQ[n], Return[n]];
       x = FromDigits[Flatten[IntegerDigits[Rest[Most[Divisors[n]]]]]];
       If[x > 10^50, Return[">10^50"], A120716[x]]];
    Table[A120716[n], {n, 1, 100}] (* Robert Price, Mar 27 2019 *)

Extensions

Edited by Michel Marcus, Mar 09 2023

A120712 Numbers k with the property that the concatenation of the nontrivial divisors of k (i.e., excluding 1 and k) is a prime.

Original entry on oeis.org

4, 6, 9, 21, 22, 25, 33, 39, 46, 49, 51, 54, 58, 78, 82, 93, 99, 111, 115, 121, 133, 141, 142, 147, 153, 154, 159, 162, 166, 169, 174, 177, 186, 187, 189, 201, 205, 219, 226, 235, 237, 247, 249, 253, 262, 267, 274, 286, 289, 291, 294, 301, 318
Offset: 1

Views

Author

Eric Angelini, Jul 19 2007

Keywords

Examples

			   k |    divisors    | concatenation
  ---+----------------+--------------
   4 | (1) 2      (4) |        2
   6 | (1) 2, 3   (6) |       23
   9 | (1) 3      (9) |        3
  21 | (1) 3, 7  (21) |       37
  22 | (1) 2, 11 (22) |      211
  25 | (1) 5     (25) |        5
  33 | (1) 3, 11 (33) |      311
  39 | (1) 3, 13 (39) |      313
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for k from 2 to 1000 do:
    v0:=divisors(k):
    nn:=nops(v0):
    if nn > 2 then
    v1:=[seq(v0[j],j=2..nn-1)]:
    v2:=cat(seq(convert(v1[n],string),n=1..nops(v1))):
    v3:=parse(v2):
    if isprime(v3) = true then lprint(k,v3) fi:
    fi:
    od: # Simon Plouffe
  • Mathematica
    fQ[n_] := PrimeQ@ FromDigits@ Most@ Rest@ Divisors@ n; Select[ Range[2, 320], fQ]
  • Python
    from sympy import divisors, isprime
    def ok(n):
        s = "".join(str(d) for d in divisors(n)[1:-1])
        return s != "" and isprime(int(s))
    print([k for k in range(319) if ok(k)]) # Michael S. Branicky, Oct 01 2024

Extensions

Name edited by Michel Marcus, Mar 09 2023

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

A130140 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 with its digits in reverse order. 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
Offset: 0

Views

Author

David Applegate, 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 -> 391 = 17*23 -> 7132.
Then 7132 has nontrivial divisors 2, 4, 1783, 3566, so we get 2438716653.
Then 2438716653 has nontrivial divisors 3, 9, 27, 81, 243, 1453, 4359, 6907, 13077, 20721, 39231, 62163, 117693, 186489, 353079, 559467, 1678401, 10035871, 30107613, 90322839, 270968517, 812905551, so we get
397218342354195347096770311270213293361263967119846819703537649551048761178530013167010393822309715869072155509218 = 2*3^4*1217*317539*1211548321*33378971294653*8960783431807*17509226460292689821646170308388500174366980857582533580184934929433.
		

Crossrefs

Extensions

Edited by Michel Marcus, Mar 09 2023

A130141 Let f denote the map that replaces k with the concatenation of its nontrivial divisors, written in decreasing 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, 53, 17, 19, 73, 23, 5, 313, 29, 31, 113
Offset: 0

Views

Author

Carsten Lund (lund(AT)research.att.com), Jul 30 2007, Aug 01 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.
The value of a(17) is currently unknown.
From Klaus Brockhaus, Aug 01 2007: (Start)
"The sequence, starting from the beginning but writing 0 when a number with more than 90 digits is reached, is:
1,3,5,7,3,11,13,53,17,19,73,23,5,313,29,31,113,0,37,197,41,43,0,47,7,173,53,0,193,
59,61,0,0,67,233,71,73,0,391393,79,9313991471335749211973,83,0,293,89,137,313,
0,97,0,101,103,0,107,109,373,113,0,391393,593,11,1993,0,127,433,131,197,0,137,139,
0,0,0,0,149,151,511793,0,157,1141931201,6113,163,0,167,13,0,173,0,593,179,181,
613,12575251553,0,0,191,193,0,197,199,673,..." (End)
From Andrew Carter (acarter09(AT)newarka.edu), Dec 16 2008: (Start)
If "when starting at 2n+1" in the definition were replaced by "when starting at n", all even-indexed terms except for a(2) and a(4) would be -1.
A simple proof is that an even number's smallest nontrivial divisor is 2, and the result of iterating f for any even number except for 2 and 4 would have factors in front, so the resulting number would be of the form 10m+2 where m is an integer greater than 1, and therefore an even number ending in 2 other than two itself, so no prime would ever be reached. (End)

Examples

			n = 13: 2n+1 = 27 has nontrivial divisors 3 and 9, so we get 93, which has proper divisors 3 and 31, so we get 313, prime. So a(13) = 313.
		

Crossrefs

Extensions

Edited by Michel Marcus, Mar 09 2023

A361581 If n is composite, replace n with the concatenation of its nontrivial divisors, written in decreasing order, each divisor being written in base 10 with its digits in reverse order, otherwise a(n) = n.

Original entry on oeis.org

1, 2, 3, 2, 5, 32, 7, 42, 3, 52, 11, 6432, 13, 72, 53, 842, 17, 9632, 19, 1542, 73, 112, 23, 2186432, 5, 312, 93, 41742, 29, 51016532, 31, 61842, 113, 712, 75, 812196432, 37, 912, 313, 2018542, 41, 12417632, 43, 221142, 51953, 322, 47, 42612186432, 7, 520152
Offset: 1

Views

Author

Tyler Busby, Mar 16 2023

Keywords

Examples

			Nontrivial divisors of 20 are 2,4,5,10, so a(20)=1542.
		

Crossrefs

Programs

  • PARI
    a(n) = if (isprime(n) || (n==1), n, my(d=divisors(n)); my(s=""); forstep(k=#d-1, 2, -1, my(dk = digits(d[k])); for (i=1, #dk, s=concat(s, Str(dk[#dk-i+1])))); eval(s)); \\ Michel Marcus, Mar 16 2023
    
  • Python
    from sympy import divisors, isprime
    def a(n):
        if n == 1 or isprime(n): return n
        return int("".join(str(d)[::-1] for d in divisors(n)[-2:0:-1]))
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Mar 21 2023
Showing 1-6 of 6 results.