login
A079794
Smallest number having k digits "k" (k=1,...,n) but any two adjacent digits are different.
0
1, 212, 132323, 1234243434, 123234535454545, 123234345464656565656, 1232343454545657576767676767, 123234345454565656767868687878787878, 123234345454565656767676787897979898989898989
OFFSET
1,2
COMMENTS
How many such numbers can be formed?
From M. F. Hasler, Jun 22 2007: (Start)
The first (n-1)(n-2)/2 digits of a(n) (part (1) of the formula) remain the same for all subsequent terms.
Terms of the sequence do not really depend on the base: for any base b>n, terms a(1)..a(n) would read the same. Thus one could add "(in base n+1)" to the definition and delete the keyword "base".
The sequence could be extended to terms n>9 in two ways: (1) by writing a(n) according to the prescription in base n+1, but recording the corresponding value in base 10; (2) by providing a convention for encoding digits d > 9, e.g. by pre-pending them with '0#' (knowing they will never occur at the beginning of a(n)), where # is the number of characters used to write the digit (encoded recursively in the same way if #>9). (End)
FORMULA
To get a(n): (1) start with an empty string and always concatenate the smallest possible of the remaining digits, until there are 2n-1 digits left (n "n"s and n-1 other digits); (2) insert the n-1 other digits in-between the "n"s and concatenate this result to the first string. (M. F. Hasler, Jun 22 2007)
EXAMPLE
a(3) = 132323 using 1, 2,2 and 3,3,3 with no two adjacent numbers same.
CROSSREFS
Sequence in context: A210257 A239045 A262657 * A197106 A138568 A201104
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Feb 05 2003
EXTENSIONS
Corrected and extended by M. F. Hasler, Jun 22 2007
STATUS
approved