login
A169858
Smallest integer k such that k or one of its left substrings (or prefixes, regarded as an integer) is divisible by any integer from {1,2,...,n}.
3
1, 2, 6, 12, 45, 60, 245, 245, 504, 504, 5049, 5049, 10296, 11760, 11760, 11760, 56160, 56160, 198016, 198016, 1008159, 1323008, 2340849, 6240366, 13442580, 13442580, 37536408, 37536408, 75432065, 75432065, 180092645, 319800096, 319800096, 800640126, 2201169600, 2201169600, 3780487275, 5250966084, 5250966084, 6832425609, 36960308625, 36960308625, 62244072512, 62244072512, 62244072512, 62244072512, 372960042489, 372960042489
OFFSET
1,2
LINKS
Hugo van der Sanden A169858: C source code to calculate terms.
FORMULA
a(n) = min m: forall d in {1..n}: exists k in {0..log_10(m)}: d | floor(m / 10^k).
a(n) <= A003418(n). - Michael S. Branicky, Jun 09 2023
EXAMPLE
a(5) = 45 as the left substrings of 45 are {4, 45} and for every d in {1,2,...,n} = {1, 2, 3, 4, 5} there is a left substring of 45 such that d | 45. That is: 1 | 4, 2 | 4, 3 | 45, 4 | 4, 5 | 45. - David A. Corneth, Jun 09 2023
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
n = 1
for k in count(1):
s = str(k)
prefixes = [int(s[:i+1]) for i in range(len(s))]
if all(any(ki%m == 0 for ki in prefixes) for m in range(1, n+1)):
yield k; n += 1
while any(ki%n == 0 for ki in prefixes):
yield k; n += 1
print(list(islice(agen(), 20))) # Michael S. Branicky, Jun 09 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hugo van der Sanden, Jun 01 2010
EXTENSIONS
Corrected and extended by Hugo van der Sanden, Jun 04 2010 (errors reported by Zak Seidov).
STATUS
approved