login
A375590
Numbers m such that there exists a nonnegative integer k for which the concatenation of m, m-1, ..., m-k is an m-digit number.
1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 150, 153, 156, 159, 162, 165, 168
OFFSET
1,2
COMMENTS
Let d be the number of digits of m (in base 10). One can show that the number m is a member of this sequence if and only if:
(a) m is divisible by d and m >= 10^(d-1) * d/(d+1)
or
(b) 10^(d-1) == 1 (mod d-1) (i.e., d-1 is a term of A014950) and m < 10^d * d/(d+1).
EXAMPLE
13 is a term because the concatenation of 13, 12, ..., 5 is a 13-digit number.
100 is not a term because the concatenation of 100, 99, ..., 52 is a 99-digit number and concatenating this number with 51 yields a 101-digit number.
MATHEMATICA
SelfDownwardConsecutiveQ[n_] :=
Module[{len = Length@IntegerDigits[n], num, c = 1, numDigits = 0},
numDigits = len*Ceiling[n + 1 - 10^(len - 1)];
If[numDigits >= n, Return[Mod[n, len] == 0]];
num = n - Ceiling[n + 1 - 10^(len - 1)];
While[numDigits < n + 1,
If[(len - c)*Ceiling[num + 1 - 10^(len - c - 1)] >= n - numDigits,
Return[Mod[n - numDigits, len - c] == 0],
numDigits += (len - c)*Ceiling[num + 1 - 10^(len - c - 1)]
];
num -= Ceiling[num + 1 - 10^(len - c - 1)];
c++;
]
]
Select[Range[1000], SelfDownwardConsecutiveQ]
CROSSREFS
Cf. A375461 (self-consecutive).
Sequence in context: A366186 A272322 A356800 * A246079 A246086 A194417
KEYWORD
easy,nonn,base
AUTHOR
STATUS
approved