A375481 Starting numbers for the terms in A035333.
1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 2, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 3, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 4, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 5, 57, 58
Offset: 1
Examples
a(19) = 12 since A035333(19) = 1213, the concatenation of 12 and 13. a(20) = 1 since A035333(20) = 1234, the concatenation of 1, 2, 3 and 4.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
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 *)
-
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
Comments