login
A104514
a(n) = least number k > 1 of consecutive integers which sum to 2*n; or a(n) = 0 if n is a power of 2.
5
0, 0, 3, 0, 4, 3, 4, 0, 3, 5, 4, 3, 4, 7, 3, 0, 4, 3, 4, 5, 3, 8, 4, 3, 4, 8, 3, 7, 4, 3, 4, 0, 3, 8, 4, 3, 4, 8, 3, 5, 4, 3, 4, 11, 3, 8, 4, 3, 4, 5, 3, 13, 4, 3, 4, 7, 3, 8, 4, 3, 4, 8, 3, 0, 4, 3, 4, 16, 3, 5, 4, 3, 4, 8, 3, 16, 4, 3, 4, 5, 3, 8, 4, 3, 4, 8, 3, 11, 4, 3, 4, 16, 3, 8, 4, 3, 4, 7, 3, 5, 4, 3, 4
OFFSET
1,3
COMMENTS
a(2^k) = 0 and a(3*n) = 3.
Least proper divisor d of 4*n (if any) such that d or 4*n/d is odd. - Robert Israel, May 06 2015
REFERENCES
Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 67.
LINKS
FORMULA
a(n) = A163169(2*n). Robert Israel, May 06 2015
EXAMPLE
a(9) = 3 because 3+4+5+6 = 5+6+7 = 2*9 = 18.
MAPLE
a:= proc(n) local divs, r;
divs:= select(t -> t::odd or (4*n/t)::odd, numtheory:-divisors(4*n) minus {1, 4*n});
if nops(divs)=0 then 0 else min(divs) fi
end proc:
seq(a(n), n=1..200); # Robert Israel, May 06 2015
MATHEMATICA
f[n_] := Block[{r = Ceiling[n/2]}, If[IntegerQ[Log[2, n]], 0, m = Range[r]; lst = Flatten[Table[m[[k]], {i, r}, {j, i + 1, r}, {k, i, j}], 1]; Min[Length /@ lst[[Flatten[Position[Plus @@@ lst, n]]]]]]]; Table[f[2n], {n, 103}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Alfred S. Posamentier (asp2(AT)juno.com) and Robert G. Wilson v, Feb 23 2005
STATUS
approved