%I #17 Apr 16 2024 13:33:07
%S 623,4,114,4,57,4,9,4,26,4,185,4,9,4,1718,4,343,4,9,4,70,4,25,4,9,4,
%T 195,4,226,4,9,4,25,4,123,4,9,4,654,4,862,4,9,4,42,4,49,4,9,4,3385,4,
%U 25,4,9,4,238,4,202,4,9,4,25,4,453,4,9,4,2435,4,721,4,9,4,49,4,70,4,9,4,186
%N The smallest composite number that divides the reverse of the concatenation of its ascending ordered prime factors, with repetition, when written in base n.
%C See A371641 for an explanation of multiple terms being 4 and 9. The largest number in the first 10000 terms is a(5980) = 1030778.
%H Scott R. Shannon, <a href="/A371695/b371695.txt">Table of n, a(n) for n = 2..10000</a>
%F If n+1 is composite, then a(n) <= A020639(n+1)^2. The numbers n where n+1 is composite and a(n) < A020639(n+1)^2 are 288, 298, 340, 360, 376, 516, 526, 550, 582, 736, ... and appear to be identical to A371948. - _Chai Wah Wu_, Apr 16 2024
%e a(2) = 623 as 623 = 7_10 * 89_10 = 111_2 * 1011001_2 = "1111011001"_2 which when reversed is "1001101111"_2 = 623_10 which is divisible by 623.
%e a(4) = 114 as 114 = 2_10 * 3_10 * 19_10 = 2_4 * 3_4 * 103_4 = "23103"_4 which when reversed is "30132"_4 = 798_10 which is divisible by 114.
%o (Python)
%o from itertools import count
%o from sympy.ntheory import digits
%o from sympy import factorint, isprime
%o def fromdigits(d, b):
%o n = 0
%o for di in d: n *= b; n += di
%o return n
%o def a(n):
%o for k in count(4):
%o if isprime(k): continue
%o sf = []
%o for p, e in list(factorint(k).items())[::-1]:
%o sf.extend(e*digits(p, n)[1:][::-1])
%o if fromdigits(sf, n)%k == 0:
%o return k
%o print([a(n) for n in range(2, 83)]) # _Michael S. Branicky_, Apr 16 2024
%Y Cf. A020639, A371641, A027746, A259047, A322843, A248915, A371948.
%K nonn,base
%O 2,1
%A _Scott R. Shannon_, Apr 03 2024