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.

Showing 1-4 of 4 results.

A331786 a(n) is the largest m such that there exists N such that none of S(N), S(N+1), ..., S(N+m-1) is divisible by n, where S(N) is the sum of digits of N.

Original entry on oeis.org

0, 2, 2, 6, 8, 8, 12, 14, 8, 18, 38, 38, 78, 98, 98, 138, 158, 98, 198, 398, 398, 798, 998, 998, 1398, 1598, 998, 1998, 3998, 3998, 7998, 9998, 9998, 13998, 15998, 9998, 19998, 39998, 39998, 79998, 99998, 99998, 139998, 159998, 99998, 199998, 399998, 399998, 799998
Offset: 1

Views

Author

Jianing Song, Jan 25 2020

Keywords

Comments

Write n = 9*s + t, 1 <= t <= 9. The smallest N_0 such that none of S(N_0), S(N_0+1), ..., S(N_0+m-1) is divisible by n is given by N_0 = 10^(u_0) - 10^s*(t-gcd(t,9)+1) + 1, where u_0 is the smallest nonnegative solution to 9*u == -gcd(t,9) (mod n). See A331787 for more detailed information.
From Bernard Schott, Mar 25 2022: (Start)
Equivalently, a(n) is the largest number of consecutive integers whose sum of digits (A007953) is never divisible by n (this is the answer to problem of Diophante link).
a(n) ends with 8 when n = 5, 6 and n >= 9 (see formula). (End)

Examples

			The following list gives the smallest example for each 2 <= n <= 27:
   2: 9..10 (2)
   3: 1..2 (2)
   4: 997..1002 (6)
   5: 6..13 (8)
   6: 7..14 (8)
   7: 994..1005 (12)
   8: 9999993..10000006 (14)
   9: 1..8 (8)
  10: 1..18 (18)
  11: 999981..1000018 (38)
  12: 1..38 (38)
  13: 9999999961..10000000038 (78)
  14: 951..1048 (98)
  15: 961..1058 (98)
  16: 9999931..10000068 (138)
  17: 999999999999921..1000000000000078 (158)
  18: 1..98 (98)
  19: 1..198 (198)
  20: 99999999801..100000000198 (398)
  21: 1..398 (398)
  22: 99999999999999601..100000000000000398 (798)
  23: 99501..100498 (998)
  24: 99601..100598 (998)
  25: 99999999301..100000000698 (1398)
  26: 99999999999999999999201..100000000000000000000798 (1598)
  27: 1..998 (998)
		

Crossrefs

Cf. A007953 (S(N)), A051885, A331788.
Row 10 of A331787.

Programs

  • PARI
    a(n) = my(s=(n-1)\9, t=(n-1)%9+1); 10^s*(2*t-gcd(t,9)+1)-2

Formula

If n = 9*s + t, 1 <= t <= 9, then a(n) = 10^s*(2*t-gcd(t,9)+1) - 2. See A331787 for a proof of the formula in base b.
Conjectures from Colin Barker, Jan 26 2020: (Start)
G.f.: 2*x^2*(1 + 2*x^2 + x^3 + 2*x^5 + x^6 - 3*x^7 + 5*x^8) / ((1 - x)*(1 - 10*x^9)).
a(n) = a(n-1) + 10*a(n-9) - 10*a(n-10) for n>10.
(End) [This conjecture is correct.]
a(n) = O(10^(n/9)).

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.

Original entry on oeis.org

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, 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, 2, 3, 4, 9, 6, 23, 24, 63, 242, 2047, 1, 3, 5, 7, 9, 11, 13, 35, 49, 127, 485, 4095
Offset: 2

Views

Author

Jianing Song, Jan 25 2020

Keywords

Comments

The main sequence is A331787; this is added because some people may search for this.

Examples

			Table begins
  b\n  1  2  3   4   5   6    7    8    9    10
   2   1  3  7  15  31  63  127  255  511  1023
   3   1  2  5   8  17  26   53   80  161   242
   4   1  3  3   7  15  15   31   63   63   127
   5   1  2  5   4   9  14   29   24   49    74
   6   1  3  5   7   5  11   23   35   47    35
   7   1  2  3   6   9   6   13   20   27    48
   8   1  3  5   7   9  11    7   15   31    47
   9   1  2  5   4   9  10   13    8   17    26
  10   1  3  3   7   9   9   13   15    9    19
		

Crossrefs

Cf. A331787.
Cf. A000225 (row 2), A062318 (row 3 with an offset shift), A331788 (row 10).

Programs

  • 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

Formula

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.
T(b,k) = A331787(b,k) + 1.
T(b,n) = T(b,n-1) + b*T(b,n-b+1) - b*T(b,n-b) for b >= 2, n >= b+1.
T(b,n) = O(b^(n/(b-1))).

A352688 a(n) is the least term of the first run of A331786(n) consecutive numbers whose sum of digits (A007953) is not divisible by n.

Original entry on oeis.org

9, 1, 997, 6, 7, 994, 9999993, 1, 1, 999981, 1, 9999999961, 951, 961, 9999931, 999999999999921, 1, 1, 99999999801, 1, 99999999999999601, 99501, 99601, 99999999301, 99999999999999999999201, 1, 1, 9999999999998001, 1, 999999999999999999996001, 9995001, 9996001
Offset: 2

Views

Author

Bernard Schott, Mar 28 2022

Keywords

Comments

A331786(n) is the number of consecutive integers in the largest such possible run.
Numbers k for which a(k) = 1 are in A352317.

Examples

			a(4) = 997 because the A331786(4) = 6 consecutive numbers 997, 998, 999, 1000, 1001, 1002 have respectively sum of digits = 25, 26, 27, 1, 2, 3 and none is divisible by 4, and there is no smaller m < 997 such that sum of digits of m, m+1, m+2, m+3, m+4, m+5 is not divisible by 4.
		

Crossrefs

Programs

  • PARI
    a(n) = my(t=gcd(n%9, 9)); if(t<9, 10^lift(Mod(-1, n/t)/(9/t)) - 10^(n\9)*(n%9-t+1) + 1, 1); \\ Jinyuan Wang, Mar 28 2022

Formula

a(n) = A352689(n) - A331786(n) + 1 for n >= 2.
a(n) = 1 if n = 9*s, s > 0 (A008591), but the converse is not true.

Extensions

More terms from Jinyuan Wang, Mar 28 2022

A352689 a(n) is the last term of the first run of A331786(n) consecutive numbers whose sum of digits (A007953) is not divisible by n.

Original entry on oeis.org

10, 2, 1002, 13, 14, 1005, 10000006, 8, 18, 1000018, 38, 10000000038, 1048, 1058, 10000068, 1000000000000078, 98, 198, 100000000198, 398, 100000000000000398, 100498, 100598, 100000000698, 100000000000000000000798, 998, 1998, 10000000000001998, 3998, 1000000000000000000003998
Offset: 2

Views

Author

Bernard Schott, Mar 28 2022

Keywords

Comments

A331786(n) is the number of consecutive integers in the largest such possible run.

Examples

			a(4) = 1002 because the A331786(4) = 6 consecutive numbers 997, 998, 999, 1000, 1001, 1002 have respectively sum of digits = 25, 26, 27, 1, 2, 3 and none is divisible by 4, and there is no smaller m < 1002 such that sum of digits of m-5, m-4, m-3, m2, m-1, m is not divisible by 4.
		

Crossrefs

Formula

a(n) = A352688(n) + A331786(n) - 1.

Extensions

More terms from Jinyuan Wang, Mar 28 2022
Showing 1-4 of 4 results.