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.

Previous Showing 21-30 of 61 results. Next

A181303 Numbers of the form i*7^j-1 (i=1..6, j >= 0).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 13, 20, 27, 34, 41, 48, 97, 146, 195, 244, 293, 342, 685, 1028, 1371, 1714, 2057, 2400, 4801, 7202, 9603, 12004, 14405, 16806, 33613, 50420, 67227, 84034, 100841, 117648, 235297, 352946, 470595, 588244, 705893, 823542, 1647085, 2470628, 3294171, 4117714, 4941257
Offset: 1

Views

Author

N. J. A. Sloane, Jan 25 2011

Keywords

Crossrefs

Smallest number whose base b sum of digits is n: A000225 (b=2), A062318 (b=3), A180516 (b=4), A181287 (b=5), A181288 (b=6), this sequence (b=7), A165804 (b=8), A140576 (b=9), A051885 (b=10). - Jason Kimberley, Nov 02 2011

Programs

  • Mathematica
    Sort[Flatten[Table[i 7^j-1,{i,1,6},{j,0,7}]]]  (* Harvey P. Dale, Feb 03 2011 *)

Formula

G.f.: x^2*(x+1)*(x^2-x+1)*(x^2+x+1) / ((x-1)*(7*x^6-1)). - Colin Barker, Feb 01 2013

A138471 Number of numbers less than n having the same sum of digits.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 4, 4, 4, 4, 4, 4, 3, 2, 1, 0, 5, 5, 5, 5, 5, 4, 3, 2, 1, 0, 6, 6, 6, 6, 5, 4, 3, 2, 1, 0, 7, 7, 7, 6, 5, 4, 3, 2, 1, 0, 8, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 4, 5, 6
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 19 2008

Keywords

Comments

A138470(n) + a(n) + A138472(n) = n;
a(A051885(n)) = 0.
a(A228915(n)) = a(n)+1. - Robert Israel, May 26 2017

Examples

			a(42)=#{6,15,24,33}=4.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get a(0) to a(N)
    C:= Vector(9*(1+ilog10(N))):
    A[0]:= 0:
    for n from 1 to N do
      s:= convert(convert(n,base,10),`+`);
      A[n]:= C[s];
      C[s]:= C[s]+1;
    od:
    seq(A[i],i=0..N); # Robert Israel, May 25 2017
  • Mathematica
    Module[{nn=110,sd},sd=Total[IntegerDigits[#]]&/@Range[nn];Join[{0},Table[ Count[Take[sd,i-1],sd[[i]]],{i,nn}]]] (* Harvey P. Dale, Aug 14 2013 *)
  • PARI
    a(n) = my(sdn=sumdigits(n)); sum(k=1, n-1, sumdigits(k) == sdn); \\ Michel Marcus, May 26 2017

A061105 Smallest number whose sum of digits is n^3.

Original entry on oeis.org

0, 1, 8, 999, 19999999, 89999999999999, 999999999999999999999999, 199999999999999999999999999999999999999, 899999999999999999999999999999999999999999999999999999999
Offset: 0

Views

Author

Amarnath Murthy, Apr 20 2001

Keywords

Comments

Except for the leading digit all the other digits of a(n), n >= 1, are 9's and the leading digit is 1 or 8. (This is because the digital sum of n^3 is congruent to 0, 1, or 8 mod 9, so the best we can do is use as many 9's as possible, prefixed if necessary by 1 or 8. - N. J. A. Sloane, Jul 19 2018)

Examples

			a(4) = 19999999, 1+9+9+9+9+9+9+9 = 64 = 4^3.
		

Crossrefs

Programs

  • Mathematica
    Do[a = {}; While[Apply[Plus, a] + 9 < n^3, a = Append[a, 9]]; If[ Apply[ Plus, a] != n^3, a = Prepend[ a, n^3 - Apply[ Plus, a]] ]; Print[ FromDigits[ a]], {n, 1, 10} ]
    dsn3[n_]:=Module[{t=(n^3-{0,1,8})/9},Which[ IntegerQ[t[[1]]],FromDigits[ PadRight[ {},t[[1]],9]],IntegerQ[t[[2]]],FromDigits[ PadRight[ {1}, t[[2]]+1,9]],IntegerQ[t[[3]]],FromDigits[PadRight[{8},t[[3]]+1,9]]]]; Array[dsn3,10,0] (* Harvey P. Dale, Jul 19 2018 *)
  • PARI
    a(n) = { ((n%3)^3 + 1)*10^(n^3\9) - 1 } \\ Harry J. Smith, Jul 19 2009

Formula

a(n) = A051885(n^3).
a(n) =((n mod 3)^3+1)*10^floor[n^3/9]-1 =(A021559(n+1)+1)*10^A061263(n)-1. - Henry Bottomley, Apr 24 2001

Extensions

More terms from Robert G. Wilson v, Apr 21 2001

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)).

A062388 Smallest palindrome with digit sum = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 55, 191, 66, 292, 77, 393, 88, 494, 99, 595, 686, 696, 787, 797, 888, 898, 989, 999, 5995, 19991, 6996, 29992, 7997, 39993, 8998, 49994, 9999, 59995, 69896, 69996, 79897, 79997, 89898, 89998, 99899, 99999, 599995, 1999991
Offset: 0

Views

Author

Amarnath Murthy, Jun 27 2001

Keywords

Examples

			191 is the smallest palindrome to have digits sum to 11.
a(28) = 5995 and no palindrome less than 5995 has digit sum 28.
		

Crossrefs

Programs

  • Mathematica
    With[{p={#,Total[IntegerDigits[#]]}&/@Select[Range[0,3*10^6],PalindromeQ]},Table[SelectFirst[p,#[[2]]==n&],{n,0,50}]][[;;,1]] (* Harvey P. Dale, Aug 13 2025 *)
  • PARI
    ispal(n) = my(d=digits(n)); Vecrev(d)==d;
    a(n) = {k = 0; while ((sumdigits(k) != n) || !ispal(k), k++); k;} \\ Michel Marcus, Aug 20 2015

Extensions

More terms from Erich Friedman, Jul 04 2001
More terms from David Wasserman, Jun 27 2002

A067043 Nondecreasing sums of digits: a(0) = 0 and for n>0: a(n) = Min{m>n|SumOfDigits(m)>= SumOfDigits(a(n-1))}, where SumOfDigits = A007953.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 19, 28, 29, 38, 39, 48, 49, 58, 59, 68, 69, 78, 79, 88, 89, 98, 99, 189, 198, 199, 289, 298, 299, 389, 398, 399, 489, 498, 499, 589, 598, 599, 689, 698, 699, 789, 798, 799, 889, 898, 899, 989, 998
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 17 2002

Keywords

Comments

A138472(a(n)) = 0. - Reinhard Zumkeller, Mar 19 2008
Positions of records in A048377: A192686(n) = A048377(a(n)). [Reinhard Zumkeller, Jul 10 2011]

Crossrefs

Programs

  • Haskell
    a067043 n = a067043_list !! n
    a067043_list = 0 : f 1 1 0 1 where
       f k x y z
         | y > 0     = (x-y) : f k x (y `div` 10) z
         | k < 9     = x : f (k+1) (2*x-k*z+1) (z `div` 10) z
         | otherwise = x : f 1 (20*z-1) z (10*z)
    -- Reinhard Zumkeller, Jul 10 2011

A087052 Lunar triangular numbers: 0+1+2+3+...+n, where + is lunar addition.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199
Offset: 0

Views

Author

Marc LeBrun and N. J. A. Sloane, Oct 19 2003

Keywords

Comments

Differs from A087121 after 100 terms.
If duplicates are removed we get A051885. - N. J. A. Sloane, Jan 25 2011

Crossrefs

Cf. A051885.

Programs

  • Maple
    (Continuing from A087062) dt := proc(n) local i,t1; t1 := 0; for i from 1 to n do t1 := dadd(t1,i); od: t1; end;

A331788 a(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.

Original entry on oeis.org

1, 3, 3, 7, 9, 9, 13, 15, 9, 19, 39, 39, 79, 99, 99, 139, 159, 99, 199, 399, 399, 799, 999, 999, 1399, 1599, 999, 1999, 3999, 3999, 7999, 9999, 9999, 13999, 15999, 9999, 19999, 39999, 39999, 79999, 99999, 99999, 139999, 159999, 99999, 199999, 399999, 399999, 799999
Offset: 1

Views

Author

Jianing Song, Jan 25 2020

Keywords

Comments

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

Examples

			See A331786.
		

Crossrefs

Cf. A007953 (S(N)), A051885, A331786.
Row 10 of A331789.

Programs

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

Formula

If n = 9*s + t, 1 <= t <= 9, then a(n) = 10^s*(2*t-gcd(t,9)+1) - 1. See A331787 for a proof of the formula in base b.
a(n) = A331786(n) + 1.
Conjectures from Colin Barker, Jan 26 2020: (Start)
G.f.: x*(1 + 2*x + 4*x^3 + 2*x^4 + 4*x^6 + 2*x^7 - 6*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)).

A061104 Smallest number whose sum of digits is n^2.

Original entry on oeis.org

0, 1, 4, 9, 79, 799, 9999, 499999, 19999999, 999999999, 199999999999, 49999999999999, 9999999999999999, 7999999999999999999, 7999999999999999999999, 9999999999999999999999999
Offset: 0

Views

Author

Amarnath Murthy, Apr 20 2001

Keywords

Examples

			a(5) = 799, 7 + 9 + 9 = 25 = 5^2.
		

Crossrefs

Programs

  • PARI
    a(n) = { (n^2%9 + 1)*10^(n^2\9) - 1 } \\ Harry J. Smith, Jul 18 2009

Formula

a(n) = A051885(n^2).
a(n) = ((n^2 mod 9) + 1)*10^floor(n^2/9) - 1. - Henry Bottomley, Apr 24 2001

A179988 Smallest m such that n = sum of digits of A108971(m).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 26, 29, 46, 49, 66, 69, 86, 89, 176, 273, 376, 473, 576, 673, 776, 873, 976, 1773, 2776, 3773, 4776, 5773, 6776, 7773, 8776, 9773, 17776, 27773, 37776
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 09 2010

Keywords

Comments

A179987(a(n)) = n and A179987(m) <> n for m < a(n);
A108971(a(n)) = A051885(n+1);
A007953(A108971(a(n))) = n;
conjecture for n>=18: a(n) = A051885(n+1) + 7*(10^floor(n/9) - 1)/9 - 3*(n mod 2).
Previous Showing 21-30 of 61 results. Next