OFFSET
1,2
COMMENTS
Minimum number of consecutive subsequent integers after n that must be concatenated together in ascending order such that n divides the concatenated term.
Concatenation always begins at n+1. Note that multiples of 11 seems to require more terms than any other number. 385 requires 9860. 451 requires 100270 terms be concatenated together into a 495,000 digit number. - Chuck Seggelin (barkeep(AT)plastereddragon.com), Oct 29 2003; corrected by Chai Wah Wu, Oct 19 2014
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
C. Seggelin, Concatenation of Consecutive Integers.
EXAMPLE
a(7) = 9 as 7 divides 8910111213141516 the concatenation of numbers from 8(= 7+1) to 16 (= 7+9).
a(5) = 5 because 5 will divide the number formed by concatenating the 5 integers after 5 in ascending order (i.e. 678910). a(385) = 9860 because 385 will divide the concatenation of 386,387,388,...,10245.
MAPLE
c[1] := 1:for n from 2 to 172 do k := 1:g := (n+k) mod n:while(true) do k := k+1:b := convert(n+k, base, 10):g := (g*10^nops(b)+n+k) mod n: if((g mod n)=0) then c[n] := k:break:fi:od:od:seq(c[l], l=1..172);
MATHEMATICA
f[n_] := Block[{k = n + 1}, d = k; While[ !IntegerQ[d/n], k++; d = d*10^Floor[Log[10, k] + 1] + k]; k - n]; Table[ f[n], {n, 1, 75}] (* Robert G. Wilson v, Nov 04 2003 *)
PROG
(Python)
def A069862(n):
....nk, kr, r = n+1, 1, 1 if n > 1 else 0
....while r:
........nk += 1
........kr = (kr + 1) % n
........r = (r*(10**len(str(nk)) % n)+kr) % n
....return nk-n # Chai Wah Wu, Oct 20 2014
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Apr 18 2002
EXTENSIONS
More terms from Sascha Kurz, Jan 28 2003
STATUS
approved