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-5 of 5 results.

A051885 Smallest number whose sum of digits is n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999
Offset: 0

Views

Author

Felice Russo, Dec 15 1999

Keywords

Comments

This is also the list of lunar triangular numbers: A087052 with duplicates removed. - N. J. A. Sloane, Jan 25 2011
Numbers n such that A061486(n) = n. - Amarnath Murthy, May 06 2001
The product of digits incremented by 1 is the same as the number incremented by 1. If a(n) = abcd...(a,b,c,d, etc. are digits of a(n)) {a(n) + 1} = (a+1)*(b+1)(c+1)*(d+1)*..., e.g., 299 + 1 = (2+1)*(9+1)*(9+1) = 300. - Amarnath Murthy, Jul 29 2003
A138471(a(n)) = 0. - Reinhard Zumkeller, Mar 19 2008
a(n+1) = A108971(A179988(n)). - Reinhard Zumkeller, Aug 09 2010, Jul 10 2011
Positions of records in A003132: A080151(n) = A003132(a(n)). - Reinhard Zumkeller, Jul 10 2011
a(n) = A242614(n,1). - Reinhard Zumkeller, Jul 16 2014
A254524(a(n)) = 1. - Reinhard Zumkeller, Oct 09 2015
The slowest strictly increasing sequence of nonnegative integers such that, for any two terms, calculating the difference of their decimal representations requires no borrowing. - Rick L. Shepherd, Aug 11 2017

Crossrefs

Numbers of form i*b^j-1 (i=1..b-1, j >= 0) for bases b = 2 through 9: A000225, A062318, A180516, A181287, A181288, A181303, A165804, A140576. - N. J. A. Sloane, Jan 25 2011
Cf. A002283.
Cf. A254524.

Programs

  • Haskell
    a051885 n = (m + 1) * 10^n' - 1 where (n',m) = divMod n 9
    -- Reinhard Zumkeller, Jul 10 2011
    
  • Magma
    [i*10^j-1: i in [1..9], j in [0..5]];
    
  • Maple
    b:=10; t1:=[]; for j from 0 to 15 do for i from 1 to b-1 do t1:=[op(t1), i*b^j-1]; od: od: t1; # N. J. A. Sloane, Jan 25 2011
  • Mathematica
    a[n_] := (Mod[n, 9] + 1)*10^Floor[n/9] - 1; Table[a[n], {n, 0, 49}](* Jean-François Alcover, Dec 01 2011, after Henry Bottomley *)
  • PARI
    A051885(n) = (n%9+1)*10^(n\9)-1  \\ M. F. Hasler, Jun 17 2012
    
  • PARI
    first(n) = Vec(x*(x^2 + x + 1)*(x^6 + x^3 + 1)/((x - 1)*(10*x^9 - 1)) + O(x^n), -n) \\ Iain Fox, Dec 30 2017
    
  • Python
    def A051885(n): return ((n % 9)+1)*10**(n//9)-1 # Chai Wah Wu, Apr 04 2021

Formula

These are the numbers i*10^j-1 (i=1..9, j >= 0). - N. J. A. Sloane, Jan 25 2011
a(n) = ((n mod 9) + 1)*10^floor(n/9) - 1 = a(n-1) + 10^floor((n-1)/9). - Henry Bottomley, Apr 24 2001
a(n) = A037124(n+1) - 1. - Reinhard Zumkeller, Jan 03 2008, Jul 10 2011
G.f.: x*(x^2+x+1)*(x^6+x^3+1) / ((x-1)*(10*x^9-1)). - Colin Barker, Feb 01 2013

Extensions

More terms from James Sellers, Dec 16 1999
Offset fixed by Reinhard Zumkeller, Jul 10 2011

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

A061263 a(n) = floor(n^3/9).

Original entry on oeis.org

0, 0, 0, 3, 7, 13, 24, 38, 56, 81, 111, 147, 192, 244, 304, 375, 455, 545, 648, 762, 888, 1029, 1183, 1351, 1536, 1736, 1952, 2187, 2439, 2709, 3000, 3310, 3640, 3993, 4367, 4763, 5184, 5628, 6096, 6591, 7111, 7657, 8232, 8834, 9464, 10125, 10815, 11535
Offset: 0

Views

Author

Henry Bottomley, Apr 24 2001

Keywords

Examples

			a(4) = floor(4^3 / 9) = floor(64/9) = 7.
		

Crossrefs

Cf. A061105.

Programs

Formula

G.f.: x^3*(3-2*x+x^2) / ( (1+x+x^2)*(x-1)^4 ). - R. J. Mathar, Feb 20 2011

A060711 Smallest number whose sum of digits is n^4.

Original entry on oeis.org

1, 79, 999999999, 49999999999999999999999999999, 4999999999999999999999999999999999999999999999999999999999999999999999, 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
Offset: 1

Views

Author

Robert G. Wilson v, Apr 21 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Do[ a = {}; While[ Apply[ Plus, a ] + 9 < n^4, a = Append[ a, 9 ] ]; If[ Apply[ Plus, a ] != n^4, a = Prepend[ a, n^4 - Apply[ Plus, a ] ] ]; Print[ FromDigits[ a ] ], {n, 1, 6} ]
  • PARI
    a(n)={ my(s=n^4, x=s\9, d=s-9*x); (d+1)*10^x - 1 } \\ Harry J. Smith, Jul 10 2009

Formula

a(n) = A051885(n^4).
a(n) >= 10^(n^4/9) - 1.

A178716 a(n) = smallest prime whose sum of digits is A001651(n).

Original entry on oeis.org

17, 19999999, 99899999999999, 299989999999999999999999999999999999999, 999999999998999999999999999999999999999999999999999999999, 9999999999999999999999999999999999999999999999999999999999999991999999999999999999999999999999999999999999999999
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Jun 07 2010

Keywords

Comments

As k runs through the numbers that are not multiples of 3, sequence gives smallest prime p whose sum of digits is k^3.
No primes exist whose sum of digits is a multiple of 3
k=4: 4^3 = 64 = 7 * 9 + 1, 8-digit prime:10^7+(10^7-1) = 2*10^7 - 1
k=5: 5^3 = 125 = 13 * 9 + 8, 14-digit prime: (10^2-1)*10^12+8*10^11+(10^11-1) = 10^14 - 10^11 - 1
k=7: 7^3 = 343 = 38 * 9 + 1: no such prime formed with 38 digits "9" and one digit "1" 343 = 37 * 9 + 2 + 8, gives as 4th term a 39-digit prime: 2*10^38+(10^3-1)*10^35+8*10^34+(10^34-1) = 3*10^38 - 10^34 - 1
k=8: 8^3 = 512 = 56 * 9 + 8, 57-digit prime: (10^11-1)*10^46+8*10^45+(10^45-1) = 10^57 - 10^45 - 1
k=10: 10^3 = 1000 = 111 * 9 + 1, 112-digit prime, 63 "leading" "9's", "1", 48 "ending" "9's": (10^63-1)*10^49+10^48+(10^48-1) = 10^112 - 8 * 10^48 - 1 = ((2*5)^(2^2^2))^7 - (2*((2*5)^(2^2^2)))^3 - 1
k=11: 11^3 = 1331 = 147 * 9 + 8: no such prime formed with 147 digits "9" and one digit "8" 1331 = 147 * 9 + 1 + 7, 149-digit prime: 10^148+(10^143-1)*10^5+7*10^4+(10^4-1) = 2*10^148 - 2*10^4 - 1

Crossrefs

Showing 1-5 of 5 results.