login
Start with a(1) = 1; then a(n) = smallest number > a(n-1) such that a(n) divides concat(a(1), a(2), ..., a(n)).
10

%I #24 Feb 18 2024 08:27:40

%S 1,2,3,5,10,12,15,20,25,30,39,44,50,100,101,125,150,188,200,220,230,

%T 250,272,304,320,370,376,400,500,525,600,615,625,1000,1250,1487,1500,

%U 1590,1696,1750,2000,2245,2500,3000,3090,3125,3800,4000,5000,5725,6122,7025

%N Start with a(1) = 1; then a(n) = smallest number > a(n-1) such that a(n) divides concat(a(1), a(2), ..., a(n)).

%C Primes appearing so far are 2, 3, 5, 101, 1487.

%H Robert G. Wilson v, <a href="/A171785/b171785.txt">Table of n, a(n) for n = 1..584</a>

%e 1: 1 divides 1

%e 1,2: 2 divides 12

%e 1,2,3: 3 divides 123

%e 1,2,3,4: 4 does NOT divide 1234, so

%e 1,2,3,5: 5 divides 1235

%e etc.

%t f[s_List] := Block[{k = s[[ -1]] + 1, conc = FromDigits[Flatten@ IntegerDigits@s]}, While[ Mod[conc*10^Floor[ Log[10, k] + 1] + k, k] != 0, k++ ]; Append[s, k]]; Nest[f, {1}, 51] (* _Robert G. Wilson v_, Oct 14 2010 *)

%t nxt[{a_,c_}]:=Module[{k=a+1},While[!Divisible[c*10^IntegerLength[k]+ k, k], k++];{k,c*10^IntegerLength[k]+k}]; Transpose[NestList[nxt,{1,1},60]][[1]] (* _Harvey P. Dale_, Mar 08 2015 *)

%Y See A029455 for numbers that divide the concatenation of all numbers <= n.

%K nonn,base

%O 1,2

%A _David Scambler_, Sep 30 2010

%E More terms from _Robert G. Wilson v_, Oct 14 2010