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.

A331789 T(b,n) is the smallest m such that for any N, at least one of S(N), S(N+1), ..., S(N+m-1) is divisible by n, where S(N) is the sum of digits of N in base b. Square array read by ascending antidiagonals.

This page as a plain text file.
%I A331789 #22 Jul 06 2024 19:45:28
%S A331789 1,1,3,1,2,7,1,3,5,15,1,2,3,8,31,1,3,5,7,17,63,1,2,5,4,15,26,127,1,3,
%T A331789 3,7,9,15,53,255,1,2,5,6,5,14,31,80,511,1,3,5,7,9,11,29,63,161,1023,1,
%U A331789 2,3,4,9,6,23,24,63,242,2047,1,3,5,7,9,11,13,35,49,127,485,4095
%N A331789 T(b,n) is the smallest m such that for any N, at least one of S(N), S(N+1), ..., S(N+m-1) is divisible by n, where S(N) is the sum of digits of N in base b. Square array read by ascending antidiagonals.
%C A331789 The main sequence is A331787; this is added because some people may search for this.
%H A331789 Jianing Song, <a href="/A331789/b331789.txt">Table of n, a(n) for n = 2..7627</a> (Note: T(b,n) occurs at the ((n+b-2)*(n+b-1)/2-b+3)-th place)
%F A331789 If n = (b-1)*s + t, 1 <= t <= b-1, then T(b,n) = b^s*(2*t-gcd(t,b-1)+1) - 1. See A331787 for a proof of the formula in base b.
%F A331789 T(b,k) = A331787(b,k) + 1.
%F A331789 T(b,n) = T(b,n-1) + b*T(b,n-b+1) - b*T(b,n-b) for b >= 2, n >= b+1.
%F A331789 T(b,n) = O(b^(n/(b-1))).
%e A331789 Table begins
%e A331789   b\n  1  2  3   4   5   6    7    8    9    10
%e A331789    2   1  3  7  15  31  63  127  255  511  1023
%e A331789    3   1  2  5   8  17  26   53   80  161   242
%e A331789    4   1  3  3   7  15  15   31   63   63   127
%e A331789    5   1  2  5   4   9  14   29   24   49    74
%e A331789    6   1  3  5   7   5  11   23   35   47    35
%e A331789    7   1  2  3   6   9   6   13   20   27    48
%e A331789    8   1  3  5   7   9  11    7   15   31    47
%e A331789    9   1  2  5   4   9  10   13    8   17    26
%e A331789   10   1  3  3   7   9   9   13   15    9    19
%o A331789 (PARI) T(b,n) = my(s=(n-1)\(b-1), t=(n-1)%(b-1)+1); b^s*(2*t-gcd(t,b-1)+1)-1
%Y A331789 Cf. A331787.
%Y A331789 Cf. A000225 (row 2), A062318 (row 3 with an offset shift), A331788 (row 10).
%K A331789 nonn,base,easy,tabl
%O A331789 2,3
%A A331789 _Jianing Song_, Jan 25 2020