login
a(1)=1; thereafter a(n) is smallest positive number not already in the sequence such that the sum a(1)+...+a(n) divides the concatenation a(1)...a(n).
4

%I #15 Apr 21 2026 14:19:35

%S 1,2,6,250488,19986,118030,133970,693810,2231328,3407286,5733260,

%T 25176334,75529002,1913932644,2692452,5413116264,6766395330,

%U 2492882490,9544178676,19819882608,10086515692,10541120510,4147755864,6025730266

%N a(1)=1; thereafter a(n) is smallest positive number not already in the sequence such that the sum a(1)+...+a(n) divides the concatenation a(1)...a(n).

%e 1+2 (=3) divides 12 --> HIT

%e 1+2+3 (=6) does not divide 123

%e 1+2+4 (=7) does not divide 124

%e 1+2+5 (=8) does not divide 125

%e 1+2+6 (=9) divides 126 --> HIT

%e ...

%e 126250488 == (1+2+6+250488) * 504

%e ...

%e The sum of the first 14 terms, 2027226147, divides their concatenation

%e 1262504881998611803013397069381022313283407286573326025176334755290021913932644,

%e giving a quotient of

%e 622774565071062988323520804204101612390759720490782533881916606559052.

%p g:= proc() local d,Q;

%p for d from 1 do

%p Q:= select(y -> y >= 10^(d-1)+s and y < 10^d + s,NumberTheory:-Divisors(10^d*c-s)) minus S;

%p if Q <> {} then return min(Q) - s fi

%p od

%p end proc:

%p s:= 1: c:= 1: R:= 1: S:= {1}:

%p for n from 2 to 15 do

%p x:= g(); s:= s + x; c:= 10^(1+ilog10(x))*c + x; S:= S union {x}; R:= R,x;

%p od:

%p R; # _Robert Israel_, Apr 21 2026

%o (Python)

%o from itertools import count, islice

%o def agen(): # generator of terms

%o an, s, c = 1, 1, "1"

%o while True:

%o yield an

%o an = next(k for k in count(1) if int(c+str(k))%(s+k) == 0)

%o s, c = s+an, c+str(an)

%o print(list(islice(agen(), 11))) # _Michael S. Branicky_, Apr 21 2026

%Y Cf. A152210, A166064, A165770, A165771.

%K nonn,base

%O 1,2

%A _N. J. A. Sloane_, Oct 07 2009, based on a posting to the Sequence Fans Mailing List by _Eric Angelini_, Sep 29 2009

%E More terms from _Jack Brennen_, _John W. Layman_, _Charles R Greathouse IV_ and _Robert G. Wilson v_, Sep 30 2009. _Jack Brennen_ found a(14).

%E Definition corrected by _Zak Seidov_, Oct 08 2009

%E a(15)-a(24) from _Donovan Johnson_, Jul 20 2010