This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A375461 #38 Sep 21 2024 02:31:03 %S A375461 1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42, %T A375461 44,46,48,50,52,54,56,58,60,62,64,66,102,105,108,111,114,117,120,123, %U A375461 126,129,132,135,138,141,144,147,150,153,156,159,162,165,168 %N A375461 Self-consecutive numbers: numbers m such that there exists a nonnegative integer k for which the concatenation of m, m+1, ..., m+k is an m-digit number. %C A375461 Let d be the number of digits of m (in base 10). One can show that the number m is a member of this sequence if and only if: %C A375461 1) m is divisible by d AND m < 10^d * d/(d+1) %C A375461 OR %C A375461 2) 10^d is divisible by d+1 AND m >= 10^d * d/(d+1). %C A375461 Equivalently, integers m in the block 10^(d-1) <= m < 10^d are included in this sequence based on their relation to the value s = 10^d * d/(d+1). If m < s, then m is in this sequence iff m is divisible by d. If m >= s, m is in this sequence iff s is an integer. Note that for d = 2, s = 66.666... so no integers m in the range 66.666... <= m < 100 are in this sequence. For d = 3, s = 750 is an integer so all integers m in the range 750 <= m < 1000 are in this sequence. - _Dominic McCarty_, Sep 09 2024 %H A375461 Dominic McCarty, <a href="/A375461/b375461.txt">Table of n, a(n) for n = 1..10000</a> %e A375461 7 is a term because if we concatenate 7, 8, 9, 10, and 11, we get 7891011, which has 7 digits. %e A375461 102 is a term because we can concatenate 102 with the next 33 consecutive integers to get a number with 34*3 = 102 digits. %e A375461 68 is not a term because if we concatenate 68,69,...,100 we get a 67-digit number and concatenating 101 with this yields a 70-digit number, so it is not possible to achieve a 68-digit number. %t A375461 SelfConsecutiveQ[n_] := %t A375461 Module[{len = Length@IntegerDigits[n], counter = 1, numDigits = 0}, %t A375461 If[len*(Power[10, len] - n) >= n, Return[Mod[n, len] == 0], %t A375461 numDigits = len*(Power[10, len] - n)]; %t A375461 Mod[n - numDigits, len + 1] == 0 %t A375461 ] %t A375461 Select[Range[1000], SelfConsecutiveQ[#] &] %o A375461 (JavaScript) function next(m){let d=(""+m).length;if(m*(d+1)<d*(10**d)){m-=m%d;if((m+d)*(d+1)>d*(10**d)){return next(10**d)}else{return m+d}}else{if((10**d)%(d+1)==0){return m+1}else{return next(10**d)}}}let m=0;a="";while(m<168){m=next(m);a+=m+", "}console.log(a) // _Dominic McCarty_, Sep 09 2024 %Y A375461 Cf. A035333 (concatenations), A375590. %K A375461 easy,nonn,base %O A375461 1,2 %A A375461 _Nicholas M. R. Frieler_, Aug 17 2024