login
A375481
Starting numbers for the terms in A035333.
1
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,2
LINKS
EXAMPLE
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.
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
For the terms generated by consecutive concatenations see A035333.For concatenations of various numbers of consecutive integers see A000027 (k=1), A127421 (k=2), A001703 (k=3), A279204 (k=4).For primes that are the concatenation of two or more consecutive integers see A052087.
Sequence in context: A053830 A033929 A025482 * A023125 A319657 A255594
KEYWORD
easy,nonn,base
AUTHOR
STATUS
approved