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

A130142 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 with its digits in reverse order. Then a(n) = first 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, 9343, 29, 31, 113, -1, 37, 313, 41, 43
Offset: 0

Views

Author

Adam L. Buchsbaum (alb(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.

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 133.
Then 133 has nontrivial divisors 7 and 19, so we get 917.
Then 917 has nontrivial divisors 7 and 131, so we get 1317.
Then 1317 has nontrivial divisors 3 and 439, so we get 9343, a prime and a(13) = 9343.
From _Sean A. Irvine_, Sep 11 2009: (Start)
Proof chain for a(17). The following gives the argument to f at each step, followed by its factorization.
35 factors as 5 * 7.
75 has factors 3 * 5 * 5.
525153 has factors 3 * 193 * 907.
15057112727099753913 has factors 3 * 4463 * 17215189 * 65325353.
179719996575730910515106159846737337176838928854211713151146478934050745192125561494032705883138679506795913535235676554615981512719833136443 has factors 29 * 29 * 5546454298803948416569 * 8370112457804191610629 * 13338101723922940394396774098231 * 345111672681489292530961043464303237918570147336150469919363833
765...4892 (3249 digits) is divisible by 2, and hence all subsequent steps will be divisible by 2, therefore no prime is ever reached, therefore a(17)=-1. (End)
		

Crossrefs

Extensions

5 more terms (details for a(17) in example). Next term requires factoring a 1478-digit number. - Sean A. Irvine, Sep 11 2009
Edited by Michel Marcus, Mar 09 2023

A361580 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 normal 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, 10542, 73, 112, 23, 1286432, 5, 132, 93, 14742, 29, 15106532, 31, 16842, 113, 172, 75, 181296432, 37, 192, 133, 20108542, 41, 21147632, 43, 221142, 15953, 232, 47, 24161286432, 7, 251052
Offset: 1

Views

Author

Tyler Busby, Mar 16 2023

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    f:= proc(n) local L;
    if isprime(n) then return n fi;
    L:= sort(convert(numtheory:-divisors(n) minus {1,n},list),`>`);
    parse(cat(op(L)))
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Mar 16 2023
  • Mathematica
    Array[If[CompositeQ[#], FromDigits@ Flatten@ Map[IntegerDigits, Reverse@ Divisors[#][[2 ;; -2]] ], #] &, 50] (* Michael De Vlieger, Mar 22 2023 *)
  • PARI
    a(n) = if (isprime(n) || (n==1), n, my(d=divisors(n)); my(s=""); for(k=2, #d-1, s=concat(Str(d[k]), s)); 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) 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.