OFFSET
1,2
COMMENTS
Any ordering of terms of the partition can be used before concatenation. - D. S. McNeil, May 09 2010
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..49
EXAMPLE
a(4) = 112: the partitions of 4 are 4,(3,1),(2,2),(1,1,2),(1,1,1,1). There are two multiples of 4, i.e., 4 and 112.
a(6) = 11112 (all partitions with one even part give multiples of 6 and 11112 is the largest).
PROG
(Python)
from collections import Counter
from operator import itemgetter
from sympy.utilities.iterables import partitions, multiset_permutations
def A079840(n):
smax, m = 0, 0
for s, p in sorted(partitions(n, size=True), key=itemgetter(0), reverse=True):
if s<smax:
break
if n % 10 or '0' in ''.join(str(d%10) for d in p):
for a in multiset_permutations(Counter(p).elements()):
if not (k:=int(''.join(str(d) for d in a))) % n:
m = max(k, m)
if m>0:
smax=s
return m # Chai Wah Wu, Feb 22 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Feb 16 2003
EXTENSIONS
Edited by D. S. McNeil, May 09 2010
At the suggestion of Charles R Greathouse IV, corrected and extended by D. S. McNeil, May 09 2010
a(22)-a(23) from Chai Wah Wu, Feb 22 2024
STATUS
approved