login
Sums of two or more consecutive nonnegative integers.
34

%I #69 Mar 14 2023 09:59:04

%S 1,3,5,6,7,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,

%T 30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,

%U 54,55,56,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77

%N Sums of two or more consecutive nonnegative integers.

%C Closely related to but different from A057716. - _N. J. A. Sloane_, May 16 2008

%C These are called polite numbers [From Howard Berman (howard_berman(AT)hotmail.com), Oct 29 2008] by those who require nonnegative integers in the definition as opposed to positive integers. With the latter requirement, 1 = 0 + 1 does not count as a polite number. [This difference of definition pointed out by Ant King (Nov 19 2010)] There is no disagreement that 1 belongs in this sequence, but there is disagreement as to whether it counts as a polite number. - _Ant King_, Nov 19 2010

%C Of course sums of two or more consecutive nonpositive integers have the same absolute values (noted while inserting "nonnegative" in title). All integers are sums of two or more consecutive integers without such restriction. - _Rick L. Shepherd_, Jun 03 2014

%C In K-12 education, these are known as "staircase numbers." The "1" is often omitted. - _Gordon Hamilton_, Mar 17 2015

%C Complement of A155559. - _Ray Chandler_, Mar 23 2016

%D J. M. Rodriguez Caballero, A characterization of the hypotenuses of primitive Pythagorean triangles ..., Amer. Math. Monthly 126 (2019), 74-77.

%D A. Wah and H. Picciotto, Algebra: Themes, Tools, Concepts, 1994, page 190.

%H Ray Chandler, <a href="/A138591/b138591.txt">Table of n, a(n) for n = 1..10000</a>

%H Tom M. Apostol, <a href="https://doi.org/10.1017/S002555720017216X">Sums of Consecutive Positive Integers</a>, The Mathematical Gazette, Vol. 87, No. 508, (March 2003).

%H Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/runsums/index.html">An Introduction to Runsums</a>

%H Mathedpage, <a href="http://www.mathedpage.org/teachers/staircases.pdf">Staircases</a>

%H NRICH, <a href="http://nrich.maths.org/public/viewer.php?obj_id=2074">Polite numbers</a>

%H Melfried Olson, <a href="http://www.jstor.org/stable/2689781">Sequentially so</a>, Mathematics Magazine 52:5, pp. 297-298.

%H Erzsébet Orosz, <a href="http://ami.ektf.hu/uploads/papers/finalpdf/AAPASM_31_from125to129.pdf">On odd-summing numbers</a>, Acia Academiae Paedagogicae Agriensis, Seciio Maihemaiicae 31 (2004), pp. 125-129.

%H PlanetMath, <a href="http://planetmath.org/?op=getobj&amp;from=objects&amp;id=10725">Polite number</a>

%H Wai Yan Pong, <a href="http://www.maa.org/sites/default/files/Pong-1-0750774.pdf">Sums of consecutive integers</a>, The College Mathematics Journal, 38 (2007), 119-123. - _Parthasarathy Nambi_, May 20 2009

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Polite_number">Polite number</a>

%F a(n) = n + A000523(n + A000523(n)). - _Charles R Greathouse IV_, Aug 12 2010

%e 0+1=1, 1+2=3, 2+3=5, 1+2+3=6, 3+4=7, 4+5=9, 1+2+3+4=10, ...

%t 1 + # + Floor[Log[2, # + 1 + Log[2, # + 1]]] &/@Range[0, 70] (* _Ant King_, Nov 18 2010 *)

%o (PARI) a(n)=n+logint(n+logint(n,2),2) \\ _Charles R Greathouse IV_, Sep 01 2015

%o (PARI) is(n)=n>>valuation(n,2)>1 || n==1 \\ _Charles R Greathouse IV_, Aug 01 2016

%o (Python)

%o def A138591(n): return len(bin(n+len(bin(n))-3)) + n - 3 # _Chai Wah Wu_, Feb 18 2022

%o (C#) BigInteger a(BigInteger n) => (n + n.GetBitLength() - 1).GetBitLength() + n - 1; // _Delbert L. Johnson_, Mar 12 2023

%Y Cf. A057716, A155559.

%K nonn,easy

%O 1,2

%A _Vladimir Joseph Stephan Orlovsky_, May 13 2008

%E More terms from _Carl R. White_, Jul 22 2009