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.

A104515 Difference between the maximum number of consecutive integers and the least number >1 of consecutive integers, the sum of which equals 2n.

This page as a plain text file.
%I A104515 #3 Mar 30 2012 17:31:12
%S A104515 0,0,0,0,0,0,0,0,1,0,0,0,0,0,3,0,0,1,0,0,4,0,0,0,3,0,4,0,0,2,0,0,4,0,
%T A104515 5,5,0,0,4,0,0,4,0,0,7,0,0,0,5,1,4,0,0,6,8,0,4,0,0,5,0,0,7,0,8,8,0,0,
%U A104515 4,3,0,6,0,0,8,0,9,9,0,0,7,0,0,5,8,0,4,0,0,9,11,0,4,0,8,0,0,3,9,3,0,9,0,0
%N A104515 Difference between the maximum number of consecutive integers and the least number >1 of consecutive integers, the sum of which equals 2n.
%C A104515 a(n)=0 iff n=2^k.
%D A104515 Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 67.
%e A104515 a(18) = 1 because 3+4+5+6 = 5+6+7 = 18.
%t A104515 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]; l = Length /@ lst[[ Flatten[ Position[ Plus @@@ lst, n]]]]; Max[l] - Min[l]]]; Table[ f[2n], {n, 105}]
%Y A104515 Cf. A104512, A104513, A104514, A104516.
%K A104515 nonn
%O A104515 1,15
%A A104515 Alfred S. Posamentier (asp2(AT)juno.com) and _Robert G. Wilson v_, Feb 23 2005