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.

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.

Original entry on oeis.org

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

Views

Author

Alfred S. Posamentier (asp2(AT)juno.com) and Robert G. Wilson v, Feb 23 2005

Keywords

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

Examples

			a(9) = 3 because 3+4+5+6 = 5+6+7 = 2*9 = 18.
		

References

  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 67.

Crossrefs

Programs

  • 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}]

Formula

a(n) = A163169(2*n). Robert Israel, May 06 2015