OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
MATHEMATICA
ConsecutiveNumber[num_, numberOfNumbers_] := Module[{},
If[numberOfNumbers == 1, Return[num]];
FromDigits@(IntegerDigits[num]~Join~
IntegerDigits@ConsecutiveNumber[num + 1, numberOfNumbers - 1])
]
ConsecutiveNumberDigits[maxDigits_] := Module[{numList = {}, c, d},
Do[
numList =
numList~Join~(Association[# -> ConsecutiveNumber[#, c]] & /@
Range[Power[10, d - 1], Power[10, d] - 1]); ,
{d, 1, Floor[maxDigits/2]}, {c, 2, Floor[maxDigits/d]}
];
SortBy[Select[numList, Values[#][[1]] < Power[10, maxDigits] &],
Values[#] &]
]
Keys[ConsecutiveNumberDigits[8]]//Flatten (* number in this line corresponds to the maximum number of digits of the concatenated terms *)
PROG
(Python)
import heapq
from itertools import islice
def agen(): # generator of terms
c = 12
h = [(c, 1, 2)]
nextcount = 3
while True:
(v, s, l) = heapq.heappop(h)
yield s
if v >= c:
c = int(str(c) + str(nextcount))
heapq.heappush(h, (c, 1, nextcount))
nextcount += 1
l += 1; v = int(str(v)[len(str(s)):] + str(l)); s += 1
heapq.heappush(h, (v, s, l))
print(list(islice(agen(), 70))) # Michael S. Branicky, Aug 18 2024
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Nicholas M. R. Frieler, Aug 17 2024
STATUS
approved