CINXE.COM

A051885 - OEIS

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <link rel="stylesheet" href="/styles.css"> <meta name="format-detection" content="telephone=no"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name=viewport content="width=device-width, initial-scale=1"> <meta name="keywords" content="OEIS,integer sequences,Sloane" /> <title>A051885 - OEIS</title> <link rel="search" type="application/opensearchdescription+xml" title="OEIS" href="/oeis.xml"> <script> var myURL = "\/A051885" function redir() { var host = document.location.hostname; if(host != "oeis.org" && host != "127.0.0.1" && !/^([0-9.]+)$/.test(host) && host != "localhost" && host != "localhost.localdomain") { document.location = "https"+":"+"//"+"oeis"+".org/" + myURL; } } function sf() { if(document.location.pathname == "/" && document.f) document.f.q.focus(); } </script> </head> <body bgcolor=#ffffff onload="redir();sf()"> <div class=loginbar> <div class=login> <a href="/login?redirect=%2fA051885">login</a> </div> </div> <div class=center><div class=top> <center> <div class=donors> The OEIS is supported by <a href="http://oeisf.org/#DONATE">the many generous donors to the OEIS Foundation</a>. </div> <div class=banner> <a href="/"><img class=banner border="0" width="600" src="/banner2021.jpg" alt="A051885 - OEIS"></a> </div> </center> </div></div> <div class=center><div class=pagebody> <div class=searchbarcenter> <form name=f action="/search" method="GET"> <div class=searchbargreet> <div class=searchbar> <div class=searchq> <input class=searchbox maxLength=1024 name=q value="" title="Search Query"> </div> <div class=searchsubmit> <input type=submit value="Search" name=go> </div> <div class=hints> <span class=hints><a href="/hints.html">Hints</a></span> </div> </div> <div class=searchgreet> (Greetings from <a href="/welcome">The On-Line Encyclopedia of Integer Sequences</a>!) </div> </div> </form> </div> <div class=sequence> <div class=space1></div> <div class=line></div> <div class=seqhead> <div class=seqnumname> <div class=seqnum> A051885 </div> <div class=seqname> Smallest number whose sum of digits is n. </div> </div> <div class=scorerefs> 61 </div> </div> <div> <div class=seqdatabox> <div class=seqdata>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</div> <div class=seqdatalinks> (<a href="/A051885/list">list</a>; <a href="/A051885/graph">graph</a>; <a href="/search?q=A051885+-id:A051885">refs</a>; <a href="/A051885/listen">listen</a>; <a href="/history?seq=A051885">history</a>; <a href="/search?q=id:A051885&fmt=text">text</a>; <a href="/A051885/internal">internal format</a>) </div> </div> </div> <div class=entry> <div class=section> <div class=sectname>OFFSET</div> <div class=sectbody> <div class=sectline>0,3</div> </div> </div> <div class=section> <div class=sectname>COMMENTS</div> <div class=sectbody> <div class=sectline>This is also the list of lunar triangular numbers: <a href="/A087052" title="Lunar triangular numbers: 0+1+2+3+...+n, where + is lunar addition.">A087052</a> with duplicates removed. - <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Jan 25 2011</div> <div class=sectline>Numbers n such that <a href="/A061486" title="Let the number of digits in n be k; a(n) = sum of the products of the digits of n taken r at a time where r ranges from 1 to k.">A061486</a>(n) = n. - <a href="/wiki/User:Amarnath_Murthy">Amarnath Murthy</a>, May 06 2001</div> <div class=sectline>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. - <a href="/wiki/User:Amarnath_Murthy">Amarnath Murthy</a>, Jul 29 2003</div> <div class=sectline><a href="/A138471" title="Number of numbers less than n having the same sum of digits.">A138471</a>(a(n)) = 0. - <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Mar 19 2008</div> <div class=sectline>a(n+1) = <a href="/A108971" title="Lexicographically earliest sequence such that in decimal representation sums of digits of consecutive terms differ exactly b...">A108971</a>(<a href="/A179988" title="Smallest m such that n = sum of digits of A108971(m).">A179988</a>(n)). - <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Aug 09 2010, Jul 10 2011</div> <div class=sectline>Positions of records in <a href="/A003132" title="Sum of squares of digits of n.">A003132</a>: <a href="/A080151" title="Let m = Wonderful Demlo number A002477(n); a(n) = sum of digits of m.">A080151</a>(n) = <a href="/A003132" title="Sum of squares of digits of n.">A003132</a>(a(n)). - <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Jul 10 2011</div> <div class=sectline>a(n) = <a href="/A242614" title="Triangle read by rows: row n contains numbers with sum of digits = n, and not greater than the n-th repunit (cf. A007953 and...">A242614</a>(n,1). - <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Jul 16 2014</div> <div class=sectline><a href="/A254524" title="n is the a(n)-th positive integer having its digitsum.">A254524</a>(a(n)) = 1. - <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Oct 09 2015</div> <div class=sectline>The slowest strictly increasing sequence of nonnegative integers such that, for any two terms, calculating the difference of their decimal representations requires no borrowing. - <a href="/wiki/User:Rick_L._Shepherd">Rick L. Shepherd</a>, Aug 11 2017</div> </div> </div> <div class=section> <div class=sectname>LINKS</div> <div class=sectbody> <div class=sectline>Iain Fox, <a href="/A051885/b051885.txt">Table of n, a(n) for n = 0..9000</a> (first 101 terms from Reinhard Zumkeller)</div> <div class=sectline>D. Applegate, M. LeBrun and N. J. A. Sloane, <a href="http://arxiv.org/abs/1107.1130">Dismal Arithmetic</a>, arXiv:1107.1130 [math.NT], 2011. [Note: we have now changed the name from &quot;dismal arithmetic&quot; to &quot;lunar arithmetic&quot; - the old name was too depressing]</div> <div class=sectline>A. Murthy, <a href="http://www.gallup.unm.edu/~smarandache/SN/ScArt5/ExploringNewIdeas.pdf">Exploring some new ideas on Smarandache type sets, functions and sequences</a>, Smarandache Notions Journal Vol. 11 N. 1-2-3 Spring 2000.</div> <div class=sectline><a href="/index/Di#dismal">Index entries for sequences related to dismal (or lunar) arithmetic</a></div> <div class=sectline><a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,10,-10).</div> </div> </div> <div class=section> <div class=sectname>FORMULA</div> <div class=sectbody> <div class=sectline>These are the numbers i*10^j-1 (i=1..9, j &gt;= 0). - <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Jan 25 2011</div> <div class=sectline>a(n) = ((n mod 9) + 1)*10^floor(n/9) - 1 = a(n-1) + 10^floor((n-1)/9). - <a href="/wiki/User:Henry_Bottomley">Henry Bottomley</a>, Apr 24 2001</div> <div class=sectline>a(n) = <a href="/A037124" title="Numbers that contain only one nonzero digit.">A037124</a>(n+1) - 1. - <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Jan 03 2008, Jul 10 2011</div> <div class=sectline>G.f.: x*(x^2+x+1)*(x^6+x^3+1) / ((x-1)*(10*x^9-1)). - <a href="/wiki/User:Colin_Barker">Colin Barker</a>, Feb 01 2013</div> </div> </div> <div class=section> <div class=sectname>MAPLE</div> <div class=sectbody> <div class=sectline>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; # <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Jan 25 2011</div> </div> </div> <div class=section> <div class=sectname>MATHEMATICA</div> <div class=sectbody> <div class=sectline>a[n_] := (Mod[n, 9] + 1)*10^Floor[n/9] - 1; Table[a[n], {n, 0, 49}](* <a href="/wiki/User:Jean-Fran莽ois_Alcover">Jean-Fran莽ois Alcover</a>, Dec 01 2011, after <a href="/wiki/User:Henry_Bottomley">Henry Bottomley</a> *)</div> </div> </div> <div class=section> <div class=sectname>PROG</div> <div class=sectbody> <div class=sectline>(Haskell)</div> <div class=sectline>a051885 n = (m + 1) * 10^n' - 1 where (n', m) = divMod n 9</div> <div class=sectline>-- <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Jul 10 2011</div> <div class=sectline>(Magma) [i*10^j-1: i in [1..9], j in [0..5]];</div> <div class=sectline>(PARI) <a href="/A051885" title="Smallest number whose sum of digits is n.">A051885</a>(n) = (n%9+1)*10^(n\9)-1 \\ <a href="/wiki/User:M._F._Hasler">M. F. Hasler</a>, Jun 17 2012</div> <div class=sectline>(PARI) first(n) = Vec(x*(x^2 + x + 1)*(x^6 + x^3 + 1)/((x - 1)*(10*x^9 - 1)) + O(x^n), -n) \\ <a href="/wiki/User:Iain_Fox">Iain Fox</a>, Dec 30 2017</div> <div class=sectline>(Python)</div> <div class=sectline>def <a href="/A051885" title="Smallest number whose sum of digits is n.">A051885</a>(n): return ((n % 9)+1)*10**(n//9)-1 # <a href="/wiki/User:Chai_Wah_Wu">Chai Wah Wu</a>, Apr 04 2021</div> </div> </div> <div class=section> <div class=sectname>CROSSREFS</div> <div class=sectbody> <div class=sectline>Cf. <a href="/A061104" title="Smallest number whose sum of digits is n^2.">A061104</a>, <a href="/A061105" title="Smallest number whose sum of digits is n^3.">A061105</a>, <a href="/A061486" title="Let the number of digits in n be k; a(n) = sum of the products of the digits of n taken r at a time where r ranges from 1 to k.">A061486</a>, <a href="/A007953" title="Digital sum (i.e., sum of digits) of n; also called digsum(n).">A007953</a>, <a href="/A067043" title="Nondecreasing sums of digits: a(0) = 0 and for n&gt;0: a(n) = Min{m&gt;n|SumOfDigits(m)&gt;= SumOfDigits(a(n-1))}, where SumOfDigits ...">A067043</a>, <a href="/A087052" title="Lunar triangular numbers: 0+1+2+3+...+n, where + is lunar addition.">A087052</a>.</div> <div class=sectline>Numbers of form i*b^j-1 (i=1..b-1, j &gt;= 0) for bases b = 2 through 9: <a href="/A000225" title="a(n) = 2^n - 1. (Sometimes called Mersenne numbers, although that name is usually reserved for A001348.)">A000225</a>, <a href="/A062318" title="Numbers of the form 3^m - 1 or 2*3^m - 1; i.e., the union of sequences A048473 and A024023.">A062318</a>, <a href="/A180516" title="Numbers of the form i*4^j-1 (i=1..3, j &gt;= 0).">A180516</a>, <a href="/A181287" title="Numbers of the form i*5^j-1 (i=1..4, j &gt;= 0).">A181287</a>, <a href="/A181288" title="Numbers of the form i*6^j-1 (i=1..5, j &gt;= 0).">A181288</a>, <a href="/A181303" title="Numbers of the form i*7^j-1 (i=1..6, j &gt;= 0).">A181303</a>, <a href="/A165804" title="Numbers of the form i*8^j-1 (i=1..7, j &gt;= 0).">A165804</a>, <a href="/A140576" title="Numbers of the form i*9^j-1 (i=1..8, j &gt;= 0).">A140576</a>. - <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Jan 25 2011</div> <div class=sectline>Cf. <a href="/A002283" title="a(n) = 10^n - 1.">A002283</a>.</div> <div class=sectline>Cf. <a href="/A254524" title="n is the a(n)-th positive integer having its digitsum.">A254524</a>.</div> <div class=sectline>Sequence in context: <a href="/A317110" title="Numbers k such that the smallest digit of k is equal to the additive digital root of k (in base 10).">A317110</a> <a href="/A340254" title="Lexicographically earliest sequence of distinct nonnegative terms such that for any n &gt;= 0, a(n+1) is obtained by altering t...">A340254</a> <a href="/A190876" title="Numbers 1 through 8 together with numbers congruent to 9 mod 10.">A190876</a> * <a href="/A227378" title="Smallest number with n = sum of distinct digits in decimal representation, cf. A217928.">A227378</a> <a href="/A226637" title="Numbers m having with m+1 no common digit in decimal representations.">A226637</a> <a href="/A274841" title="Number of set partitions of [n] such that the difference between each element and its block index is a multiple of eight.">A274841</a></div> <div class=sectline>Adjacent sequences: <a href="/A051882" title="Call m strict-sense Egyptian if we can partition m = x_1+x_2+...+x_k into distinct positive integers x_i such that Sum_{i=1....">A051882</a> <a href="/A051883" title="a(n) is the smallest number such that the concatenation of a(1)a(2)a(3)...a(n) is divisible by n.">A051883</a> <a href="/A051884" title="Smallest number larger than the previous term which is not a prime but is relatively prime to the previous term.">A051884</a> * <a href="/A051886" title="a(n) is the minimal prime p such that 2^n * p + 1 is prime.">A051886</a> <a href="/A051887" title="Minimal and special 2k-Germain primes, where 2k is in A002110 (primorial numbers).">A051887</a> <a href="/A051888" title="a(n) is the smallest prime p such that p*n! + 1 is prime.">A051888</a></div> </div> </div> <div class=section> <div class=sectname>KEYWORD</div> <div class=sectbody> <div class=sectline><span title="a sequence of nonnegative numbers">nonn</span>,<span title="it is very easy to produce terms of sequence">easy</span>,<span title="dependent on base used for sequence">base</span>,<span title="an exceptionally nice sequence">nice</span>,<span title="sequence has an interesting graph"><a href="/A051885/graph">look</a></span></div> </div> </div> <div class=section> <div class=sectname>AUTHOR</div> <div class=sectbody> <div class=sectline><a href="/wiki/User:Felice_Russo">Felice Russo</a>, Dec 15 1999</div> </div> </div> <div class=section> <div class=sectname>EXTENSIONS</div> <div class=sectbody> <div class=sectline>More terms from <a href="/wiki/User:James_A._Sellers">James A. Sellers</a>, Dec 16 1999</div> <div class=sectline>Offset fixed by <a href="/wiki/User:Reinhard_Zumkeller">Reinhard Zumkeller</a>, Jul 10 2011</div> </div> </div> <div class=section> <div class=sectname>STATUS</div> <div class=sectbody> <div class=sectline>approved</div> </div> </div> </div> <div class=space10></div> </div> </div></div> <p> <div class=footerpad></div> <div class=footer> <center> <div class=bottom> <div class=linksbar> <a href="/">Lookup</a> <a href="/wiki/Welcome"><font color="red">Welcome</font></a> <a href="/wiki/Main_Page"><font color="red">Wiki</font></a> <a href="/wiki/Special:RequestAccount">Register</a> <a href="/play.html">Music</a> <a href="/plot2.html">Plot 2</a> <a href="/demo1.html">Demos</a> <a href="/wiki/Index_to_OEIS">Index</a> <a href="/webcam">WebCam</a> <a href="/Submit.html">Contribute</a> <a href="/eishelp2.html">Format</a> <a href="/wiki/Style_Sheet">Style Sheet</a> <a href="/transforms.html">Transforms</a> <a href="/ol.html">Superseeker</a> <a href="/recent">Recents</a> </div> <div class=linksbar> <a href="/community.html">The OEIS Community</a> </div> <div class=linksbar> Maintained by <a href="http://oeisf.org">The OEIS Foundation Inc.</a> </div> <div class=dbinfo>Last modified February 21 13:07 EST 2025. Contains 381091 sequences.</div> <div class=legal> <a href="/wiki/Legal_Documents">License Agreements, Terms of Use, Privacy Policy</a> </div> </div> </center> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10