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!)
A348895 Largest n-digit number such that the remainder after dividing by sum of digits is A348730(n). 2
9, 79, 799, 9887, 98999, 999599, 9999968, 99998989, 999989999, 9999989998, 99999999799, 999999999959, 9999999799999, 99999999998999, 999999999999797, 9999999999989999, 99999999999999988, 999999999999979999, 9999999999999998999, 99999899999999999989, 999999999999999899998 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Subsequence of A348799.
LINKS
PROG
(Python)
from functools import lru_cache
from sympy.combinatorics.partitions import IntegerPartition
from sympy.utilities.iterables import partitions, multiset_permutations
@lru_cache(maxsize=None)
def intpartition(n, m): return tuple(''.join(str(d) for d in IntegerPartition(p).partition+[0]*(m-s)) for s, p in partitions(n, k=9, m=m, size=True))
def A348895(n):
l, c, nmax, k = 9*n, 0, 0, 10**(n-1)
while l > c:
for p in intpartition(l, n):
for q in multiset_permutations(p):
w = int(''.join(q))
if w >= k:
wr = w % l
if wr > c:
c = wr
nmax = w
if wr == c and nmax < w:
nmax = w
l -= 1
return nmax
CROSSREFS
Sequence in context: A083411 A181279 A173808 * A293723 A255807 A293916
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Nov 02 2021
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 April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)