cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A375590 #16 Sep 13 2024 07:39:31
%S A375590 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,
%T A375590 36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,
%U A375590 82,84,86,88,90,92,94,96,98,150,153,156,159,162,165,168
%N 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.
%C A375590 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:
%C A375590    (a) m is divisible by d and m >= 10^(d-1) * d/(d+1)
%C A375590     or
%C A375590    (b) 10^(d-1) == 1 (mod d-1) (i.e., d-1 is a term of A014950) and m < 10^d * d/(d+1).
%e A375590 13 is a term because the concatenation of 13, 12, ..., 5 is a 13-digit number.
%e A375590 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.
%t A375590 SelfDownwardConsecutiveQ[n_] :=
%t A375590  Module[{len = Length@IntegerDigits[n], num, c = 1, numDigits = 0},
%t A375590   numDigits = len*Ceiling[n + 1 - 10^(len - 1)];
%t A375590 If[numDigits >= n, Return[Mod[n, len] == 0]];
%t A375590 num = n - Ceiling[n + 1 - 10^(len - 1)];
%t A375590 While[numDigits < n + 1,
%t A375590   If[(len - c)*Ceiling[num + 1 - 10^(len - c - 1)] >= n - numDigits,
%t A375590    Return[Mod[n - numDigits, len - c] == 0],
%t A375590    numDigits += (len - c)*Ceiling[num + 1 - 10^(len - c - 1)]
%t A375590     ];
%t A375590   num -= Ceiling[num + 1 - 10^(len - c - 1)];
%t A375590   c++;
%t A375590    ]
%t A375590  ]
%t A375590 Select[Range[1000], SelfDownwardConsecutiveQ]
%Y A375590 Cf. A375461 (self-consecutive).
%K A375590 easy,nonn,base
%O A375590 1,2
%A A375590 _Nicholas M. R. Frieler_, Aug 19 2024