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.
%I A378119 #26 Dec 28 2024 15:49:24 %S A378119 1,19,-1,39,49999,-1,69999,79,-1,18999999999,2899999,-1,48999, %T A378119 5899999999999,-1,78999999999,8899,-1,19899999999999999999, %U A378119 298999999999,-1,49899999,598999999999999999999,-1,79899999999999999,898999,-1,19989999999999999999999999999,29989999999999999,-1 %N A378119 a(n) is the smallest positive k such that the digit sums of k and k + 1 are both divisible by n, or -1 if no such pair exists. %C A378119 It is clear that a(n) must be -1 if n is a multiple of three since if we assume (hoping for a contradiction) that there exist k, k+1 both of which have digit sums that are multiples of 3, then k and k+1 must themselves both be divisible by 3, a contradiction. %H A378119 Colin Beveridge, <a href="/A378119/a378119.txt">Proof of formula</a> %F A378119 a(n) = A051885(n) * 10^q - 1, where q is 9^(-1) (mod n) for n > 1 and n not a multiple of 3 (see linked proof). - _Colin Beveridge_, Dec 16 2024 %e A378119 a(2) = 19 because both 19 and 20 have digit sums that are multiples of 2: 1+9 = 10 = 5*2 and 2+0 = 2 = 1*2, it is easily checked (by exhaustion) that there is no smaller pair of consecutive integers with this property. %o A378119 (Python) %o A378119 def A378119(n): %o A378119 if n == 1: %o A378119 return 1 %o A378119 elif n % 3 == 0: %o A378119 return -1 %o A378119 else: %o A378119 return (((n%9)+1)*10**(n//9)-1)*(10**pow(9,-1,n))-1 %o A378119 # _Colin Beveridge_, Dec 13 2024 %Y A378119 Cf. A007953, A051885. %K A378119 sign,base %O A378119 1,2 %A A378119 _Barney Maunder-Taylor_, Nov 16 2024