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

A037280 If n is composite replace n with the concatenation of its nontrivial divisors [ A037279 ] then divide out any factors of 2.

Original entry on oeis.org

1, 1, 3, 1, 5, 23, 7, 3, 3, 25, 11, 1173, 13, 27, 35, 31, 17, 2369, 19, 12255, 37, 211, 23, 586703, 5, 213, 39, 12357, 29, 23561015, 31, 1551, 311, 217, 57, 117345609, 37, 219, 313, 6145255, 41, 23671421, 43, 120561, 35915, 223, 47, 2933515203, 7, 251025, 317
Offset: 1

Views

Author

Keywords

Examples

			Divisors of 12 are 1,2,3,4,6,12, so 12 -> 2346 = 2*1173 -> 1173 = a(12).
		

Crossrefs

Cf. A037279.

Programs

  • Maple
    with(numtheory):ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: a:=proc(n) options remember: local d,i,l,m: if n<3 then RETURN(1) else if not isprime(n) then d:=divisors(n): l:=nops(d): m:=ds([seq(op(convert(d[l-i+1],base,10)),i=2..l-1)]): RETURN(m/piecewise(m mod 2=1,1,2^(ifactors(m)[2][1][2]))) else RETURN(n) fi fi: end; seq(a(n),n=1..70); # C. Ronaldo

Extensions

More terms from Erich Friedman

A106708 a(n) is the concatenation of its nontrivial divisors.

Original entry on oeis.org

0, 0, 0, 2, 0, 23, 0, 24, 3, 25, 0, 2346, 0, 27, 35, 248, 0, 2369, 0, 24510, 37, 211, 0, 2346812, 5, 213, 39, 24714, 0, 23561015, 0, 24816, 311, 217, 57, 234691218, 0, 219, 313, 24581020, 0, 23671421, 0, 241122, 35915, 223, 0, 23468121624, 7, 251025, 317
Offset: 1

Views

Author

N. J. A. Sloane, Jul 20 2007

Keywords

Crossrefs

Cf. A037278, A120712, A037279, A131983 (records), A131984 (where records occur).

Programs

  • Haskell
    a106708 1           = 0
    a106708 n
       | a010051 n == 1 = 0
       | otherwise = read $ concat $ (map show) $ init $ tail $ a027750_row n
    -- Reinhard Zumkeller, May 01 2012
    
  • Maple
    A106708 := proc(n) local dvs ; if isprime(n) or n = 1 then 0; else dvs := [op(numtheory[divisors](n) minus {1,n} )] ; dvs := sort(dvs) ; cat(op(dvs)) ; fi ; end: seq(A106708(n),n=1..80) ; # R. J. Mathar, Aug 01 2007
  • Mathematica
    Table[If[CompositeQ[n],FromDigits[Flatten[IntegerDigits/@Rest[ Most[ Divisors[ n]]]]],0],{n,60}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 22 2020 *)
  • PARI
    {map(n) = local(d); d=divisors(n); if(#d<3, 0, d[1]=""; eval(concat(vecextract(d, concat("..", #d-1)))))}
    for(n=1,51,print1(map(n),",")) /* Klaus Brockhaus, Aug 05 2007 */
    
  • Python
    from sympy import divisors
    def a(n):
      nontrivial_divisors = [d for d in divisors(n)[1:-1]]
      if len(nontrivial_divisors) == 0: return 0
      else: return int("".join(str(d) for d in nontrivial_divisors))
    print([a(n) for n in range(1, 52)]) # Michael S. Branicky, Dec 31 2020

Formula

a(n) = A037279(n) * A010051(n). - R. J. Mathar, Aug 01 2007

Extensions

More terms from R. J. Mathar and Klaus Brockhaus, Aug 01 2007
Name edited by Michael S. Branicky, Dec 31 2020

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

A191647 Numbers n with property that the concatenation of their anti-divisors is a prime.

Original entry on oeis.org

3, 4, 5, 10, 14, 16, 40, 46, 100, 145, 149, 251, 340, 373, 406, 424, 439, 466, 539, 556, 571, 575, 617, 619, 628, 629, 655, 676, 689, 724, 760, 779, 794, 899, 901, 941, 970, 989, 1019, 1055, 1070, 1076, 1183, 1213, 1226, 1231, 1258, 1270, 1285, 1331, 1340
Offset: 1

Views

Author

Paolo P. Lava, Jun 10 2011

Keywords

Comments

Similar to A120712 which uses the proper divisors of n.

Examples

			The anti-divisors of 40 are 3, 9, 16, 27, and 391627 is prime, hence 40 is in the sequence.
		

Crossrefs

Programs

  • Maple
    P:=proc(i) local a,b,c,d,k,n,s,v; v:=array(1..200000);
    for n from 3 by 1 to i do k:=2; b:=0;
    while k0 and (2*n mod k)=0 then b:=b+1; v[b]:=k; fi;
         else
         if (n mod k)>0 and (((2*n-1) mod k)=0 or ((2*n+1) mod k)=0) then
    b:=b+1; v[b]:=k; fi; fi; k:=k+1; od; a:=v[1];
    for s from 2 to b do a:=a*10^floor(1+evalf(log10(v[s])))+v[s]; od;
    if isprime(a) then print(n); fi;
    od; end: P(10^6);
  • Mathematica
    antiDivisors[n_Integer] := Cases[Range[2, n - 1], _?(Abs[Mod[n, #] - #/2] < 1 &)]; a191647[n_Integer] := Select[Range[n],
    PrimeQ[FromDigits[Flatten[IntegerDigits /@ antiDivisors[#]]]] &]; a191647[1350] (* Michael De Vlieger, Aug 09 2014, "antiDivisors" after Harvey P. Dale at A066272 *)
  • Python
    from sympy import isprime
    [n for n in range(3,10**4) if isprime(int(''.join([str(d) for d in range(2,n) if n%d and 2*n%d in [d-1,0,1]])))] # Chai Wah Wu, Aug 08 2014

Extensions

a(618) corrected in b-file by Paolo P. Lava, Feb 28 2018

A037281 Number of iterations of transformation in A037280 needed to reach 1 or a prime, or -1 if no such number exists.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 1, 2, 0
Offset: 1

Views

Author

Keywords

Comments

Continuation from a(12): -1, 0, 3, 4, 1, 0, -1, 0, -1, 1, 1, 0, -1, 1, 4, 2, -1, 0, -1, 0, 2, 1, -1, 3, -1, 0, 2, 1, -1, 0, -1, 0, -1, -1, 1, 0, -1, 1, -1, 1, -1, 0, 1, 2, -1, 2, 1, 0, -1; where all the -1's are conjectural. - Franklin T. Adams-Watters, Jul 28 2011

Crossrefs

Cf. A037279.

Programs

  • Maple
    with(numtheory):ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: a:=proc(n) options remember: local d,i,l,m: if n<3 then RETURN(1) else if not isprime(n) then d:=divisors(n): l:=nops(d): m:=ds([seq(op(convert(d[l-i+1],base,10)),i=2..l-1)]): RETURN(m/piecewise(m mod 2=1,1,2^(ifactors(m)[2][1][2]))) else RETURN(n) fi fi: end; for n from 1 to 11 do m:=n: for i from 0 while(not isprime(m) and m<>1) do m:=a(m) od: printf("%d, ",i) od: # C. Ronaldo

Extensions

Corrected by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 29 2004

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

A361320 If n is composite, replace n with the concatenation of its nontrivial divisors, written in increasing 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, 23, 7, 24, 3, 25, 11, 2346, 13, 27, 35, 248, 17, 2369, 19, 24501, 37, 211, 23, 2346821, 5, 231, 39, 24741, 29, 23560151, 31, 24861, 311, 271, 57, 234692181, 37, 291, 331, 24580102, 41, 23674112, 43, 241122, 35951, 232, 47, 23468216142, 7, 250152
Offset: 1

Views

Author

Tyler Busby, Mar 09 2023

Keywords

Comments

First differs from A037279 at a(20).

Examples

			Divisors of 20 are 1,2,4,5,10,20, so a(20)=24501.
		

Crossrefs

Programs

  • PARI
    a(n) = if (isprime(n) || (n==1), return (n)); my(d=divisors(n), list=List()); for (i=2, #d-1, my(dd=digits(d[i])); forstep (j=#dd, 1, -1, listput(list, dd[j]))); fromdigits(Vec(list)); \\ 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-10 of 10 results.