OFFSET
1,3
COMMENTS
n is the sum of at most a(n) consecutive positive integers. As suggested by David W. Wilson, Aug 15 2005: Suppose n is to be written as sum of k consecutive integers starting with m, then 2n = k(2m + k - 1). Only one of the factors is odd. For each odd divisor d of n there is a unique corresponding k = min(d,2n/d). a(n) is the largest among those k. - Jaap Spies, Aug 16 2005
The numbers that can be written as a sum of k consecutive positive integers are those in column k of A141419 (as a triangle). - Peter Munn, Mar 01 2019
The numbers that cannot be written as a sum of two or more consecutive positive integers are the powers of 2. So a(n) = 1 iff n = 2^k for k >= 0. - Bernard Schott, Mar 03 2019
LINKS
Donovan Johnson, Table of n, a(n) for n = 1..10000
K. S. Brown's Mathpages, Partitions into Consecutive Integers
A. Heiligenbrunner, Sum of adjacent numbers (in German).
Jaap Spies, Problem C NAW 5/6 nr. 2 June 2005, July 2005 (solution to problem below).
Jaap Spies, Sage program for computing A109814
Universitaire Wiskunde Competitie, Problem C, Nieuw Archief voor Wiskunde, 5/6, no. 2, Problems/UWC, Jun 2005, pp. 181-182.
FORMULA
From Reinhard Zumkeller, Apr 18 2006: (Start)
a(n)*(a(n)+2*A118235(n)-1)/2 = n;
a(A000079(n)) = 1;
a(A000217(n)) = n. (End)
EXAMPLE
Examples provided by Rainer Rosenthal, Apr 01 2008:
1 = 1 ---> a(1) = 1
2 = 2 ---> a(2) = 1
3 = 1+2 ---> a(3) = 2
4 = 4 ---> a(4) = 1
5 = 2+3 ---> a(5) = 2
6 = 1+2+3 ---> a(6) = 3
a(15) = 5: 15 = 15 (k=1), 15 = 7+8 (k=2), 15 = 4+5+6 (k=3) and 15 = 1+2+3+4+5 (k=5). - Jaap Spies, Aug 16 2005
MAPLE
A109814:= proc(n) local m, k, d; m := 0; for d from 1 by 2 to n do if n mod d = 0 then k := min(d, 2*n/d): fi; if k > m then m := k fi: od; return(m); end proc; seq(A109814(i), i=1..150); # Jaap Spies, Aug 16 2005
MATHEMATICA
a[n_] := Reap[Do[If[OddQ[d], Sow[Min[d, 2n/d]]], {d, Divisors[n]}]][[2, 1]] // Max; Table[a[n], {n, 1, 102}]
PROG
(Sage)
[sloane.A109814(n) for n in range(1, 20)]
# Jaap Spies, Aug 16 2005
(Python)
from sympy import divisors
def a(n): return max(min(d, 2*n//d) for d in divisors(n) if d&1)
print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Dec 23 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Aug 23 2008 at the suggestion of R. J. Mathar
STATUS
approved