The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
Nontrivial divisors of 20 are 2,4,5,10, so a(20)=10542.
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 *)
PROG
(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
CROSSREFS
Sequence in context: A163591 A085307 A361581 * A353975 A078599 A183103
KEYWORD
nonn,base
AUTHOR
Tyler Busby, Mar 16 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 20 21:47 EDT 2024. Contains 372720 sequences. (Running on oeis4.)