login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A214771
a(n) is the smallest number that can be written as the sum of consecutive positive integers in at least n ways.
3
3, 9, 15, 45, 45, 105, 105, 225, 315, 315, 315, 945, 945, 945, 945, 1575, 1575, 2835, 2835, 3465, 3465, 3465, 3465, 10395, 10395, 10395, 10395, 10395, 10395, 10395, 10395, 17325, 17325, 17325, 17325, 31185, 31185, 31185, 31185, 45045, 45045, 45045, 45045
OFFSET
1,1
COMMENTS
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.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..200 from T. D. Noe; terms 576 onward using A053624)
Zach Wissner-Gross, The Riddler, Solution to last week's Riddler Express, FiveThirtyEight, Feb 18 2022.
FORMULA
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
EXAMPLE
a(1) = 3 = 1+2;
a(2) = 9 = 4+5 = 2+3+4;
a(3) = 15 = 7+8 = 4+5+6 = 1+2+3+4+5;
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.
MATHEMATICA
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 *)
PROG
(Python)
import heapq
from itertools import islice
def agen(): # generator of terms
p = v = 3; h = [(v, 1, 2)]; nextcount = 3; oldv = ways = highways = 0
while True:
(v, s, l) = heapq.heappop(h)
if v == oldv: ways += 1
else:
if ways > highways:
for n in range(highways+1, ways+1):
yield oldv
highways = ways
ways = 1
if v >= p:
p += nextcount
heapq.heappush(h, (p, 1, nextcount))
nextcount += 1
oldv = v
v -= s; s += 1; l += 1; v += l
heapq.heappush(h, (v, s, l))
print(list(islice(agen(), 50))) # Michael S. Branicky, Feb 18 2022
CROSSREFS
Cf. A053624 (union of these terms), A057716 (not powers of 2).
Sequence in context: A228916 A345431 A082702 * A065917 A355772 A355771
KEYWORD
nonn
AUTHOR
Robin Garcia, Jul 27 2012
EXTENSIONS
Definition corrected by Jonathan Sondow, Feb 19 2014
STATUS
approved