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!)
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. 0
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 (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)=1542.
PROG
(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
CROSSREFS
Sequence in context: A037279 A163591 A085307 * A361580 A353975 A078599
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 August 19 10:34 EDT 2024. Contains 375284 sequences. (Running on oeis4.)