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.

A214771 a(n) is the smallest number that can be written as the sum of consecutive positive integers in at least n ways.

This page as a plain text file.
%I A214771 #32 Feb 18 2022 22:48:46
%S A214771 3,9,15,45,45,105,105,225,315,315,315,945,945,945,945,1575,1575,2835,
%T A214771 2835,3465,3465,3465,3465,10395,10395,10395,10395,10395,10395,10395,
%U A214771 10395,17325,17325,17325,17325,31185,31185,31185,31185,45045,45045,45045,45045
%N A214771 a(n) is the smallest number that can be written as the sum of consecutive positive integers in at least n ways.
%C A214771 The number of forms of writing a number x with odd prime factors as distinct sums of at least two nonzero summands of consecutive positive integers is: d(2x)/2 -1 = d(x) - 1, where d(x) is the number of divisors of x.
%H A214771 Michael S. Branicky, <a href="/A214771/b214771.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..200 from T. D. Noe; terms 576 onward using A053624)
%H A214771 Zach Wissner-Gross, The Riddler, <a href="https://fivethirtyeight.com/features/can-you-find-the-luckiest-coin/">Solution to last week's Riddler Express</a>, FiveThirtyEight, Feb 18 2022.
%F A214771 a(n) = A053624(i) for n in d(A053624(i-1))..d(A053624(i))-1, where d(x) is the number of divisors of x. - _Michael S. Branicky_, Feb 18 2022
%e A214771 a(1) = 3 = 1+2;
%e A214771 a(2) = 9 = 4+5 = 2+3+4;
%e A214771 a(3) = 15 = 7+8 = 4+5+6 = 1+2+3+4+5;
%e A214771 a(4) = a(5) = 45 is the sum of 2,3,5,6 and 9 consecutive integers beginning with 22, 14, 7, 5 and 1 respectively.
%t A214771 nn = 50000; t = Table[0, {nn}]; Do[tot = i; j = i; While[j++; tot = tot + j; tot <= nn, t[[tot]]++], {i, nn/2 - 1}]; Table[Position[t, _?(# >= n &), 1, 1][[1, 1]], {n, Max[t]}] (* _T. D. Noe_, Jul 28 2012 *)
%o A214771 (Python)
%o A214771 import heapq
%o A214771 from itertools import islice
%o A214771 def agen(): # generator of terms
%o A214771     p = v = 3; h = [(v, 1, 2)]; nextcount = 3; oldv = ways = highways = 0
%o A214771     while True:
%o A214771         (v, s, l) = heapq.heappop(h)
%o A214771         if v == oldv: ways += 1
%o A214771         else:
%o A214771             if ways > highways:
%o A214771                 for n in range(highways+1, ways+1):
%o A214771                     yield oldv
%o A214771                 highways = ways
%o A214771             ways = 1
%o A214771         if v >= p:
%o A214771             p += nextcount
%o A214771             heapq.heappush(h, (p, 1, nextcount))
%o A214771             nextcount += 1
%o A214771         oldv = v
%o A214771         v -= s; s += 1; l += 1; v += l
%o A214771         heapq.heappush(h, (v, s, l))
%o A214771 print(list(islice(agen(), 50))) # _Michael S. Branicky_, Feb 18 2022
%Y A214771 Cf. A053624 (union of these terms), A057716 (not powers of 2).
%K A214771 nonn
%O A214771 1,1
%A A214771 _Robin Garcia_, Jul 27 2012
%E A214771 Definition corrected by _Jonathan Sondow_, Feb 19 2014