login
a(n) is the smallest multiple of 7 that can be formed by concatenating the first n positive integers in some order.
0

%I #20 Feb 15 2022 16:35:19

%S 21,231,3241,12453,123564,1234576,12347685,123456879,10123456798,

%T 1011123456798,101111223456789,10111121323457896,1011112131423457896,

%U 101111213141523456879,10111121314151623456789,1011112131415161723456789,101111213141516171823458796

%N a(n) is the smallest multiple of 7 that can be formed by concatenating the first n positive integers in some order.

%e (2, 1) 21

%e (2, 3, 1) 231

%e (3, 2, 4, 1) 3241

%e (1, 2, 4, 5, 3) 12453

%e (1, 2, 3, 5, 6, 4) 123564

%e (1, 2, 3, 4, 5, 7, 6) 1234576

%e (1, 2, 3, 4, 7, 6, 8, 5) 12347685

%e (1, 2, 3, 4, 5, 6, 8, 7, 9) 123456879

%e From _Jon E. Schoenfield_, Jan 07 2022: (Start)

%e Observation: for each term from a(2) through a(18), if the positive integers are originally arranged in a string of digits in order from 1 through 9 (or 1 through n for n < 9), left to right, and then (for n > 9) the remaining numbers are incorporated into the string by placing '10' to the left of the initial '1' and then placing all remaining numbers in order from left to right between the '1' and the '2' (e.g., so as to yield the concatenation 10/1/11/12/13/14/15/16/17/18/2/3/4/5/6/7/8/9 for n=18), then at most 4 digits at the right end of the concatenated string need to be rearranged to obtain a(n), as shown here, where a space is inserted to the left of the digits (if any) that need to be rearranged:

%e 21

%e 231

%e 3241

%e 12 453

%e 123 564

%e 12345 76

%e 1234 7685

%e 123456 879

%e 101234567 98

%e 10111234567 98

%e 101111223456789

%e 1011112132345 7896

%e 101111213142345 7896

%e 101111213141523456 879

%e 10111121314151623456789

%e 1011112131415161723456789

%e 10111121314151617182345 8796

%e (End)

%Y Cf. A008589.

%K nonn,base

%O 2,1

%A _Claudio Meller_, Jan 06 2022

%E a(12)-a(18) from _Jon E. Schoenfield_, Jan 06 2022