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.
%I A220400 #32 Dec 28 2017 19:32:15 %S A220400 0,0,0,0,1,0,0,0,1,1,0,0,1,0,0,1,2,0,0,0,1,1,0,0,2,1,0,1,1,0,0,0,2,1, %T A220400 0,1,2,0,0,1,2,0,0,0,1,2,0,0,3,1,0,1,1,0,0,1,2,1,0,0,2,0,0,2,3,1,0,0, %U A220400 1,1,0,0,3,0,0,2,1,1,0,0,3,2,0,0,2,1,0,1,2,0,0,1,1,1,0,1,4,0,0,2,2,0,0,0,2,3 %N A220400 Number of ways to write n as sum of at least 2 consecutive odd positive integers. %C A220400 Records occur at 0, 4, 16, 48, 96, 144, 240, 480, 720, 960, 1440, ..., (A297160). - _Antti Karttunen_, Dec 27 2017 %C A220400 Also number of ways to express n in the form k + (k + 2) + ... + (k + 2*m - 2) = m * (k + m - 1) where k > 0 is odd and m > 0 and m * (m + 1) < n. - _David A. Corneth_, Dec 27 2017 %H A220400 Antti Karttunen, <a href="/A220400/b220400.txt">Table of n, a(n) for n = 0..11111</a> %e A220400 For n=16 we can write 1+3+5+7 and 7+9, thus a(16) = 2. %e A220400 For n = 24, we look for sums of consecutive numbers of m terms of the form m * (k + m - 1) for odd k and m * (m + 1) < 24, i.e., m < 5. We can factorize 24 as such in two positive factors as 1 * 24 = 2 * 12 = 3 * 8 = 4 * 6 giving m = 1, 2, 3 and 4 respectively. Solving for k gives k = 24, k = 11, k = 6 and k = 3 respectively. Of these values, two are odd so a(24) = 2. Superfluously, the corresponding sums are 11 + 13 = 3 + 5 + 7 + 9. - _David A. Corneth_, Dec 28 2017 %t A220400 nn = 100; t = Table[0, {nn}]; Do[s = odd = 2*n - 1; While[odd = odd + 2; s = s + odd; s <= nn, t[[s]]++], {n, nn/2}]; Join[{0}, t] (* _T. D. Noe_, Dec 18 2012 *) %o A220400 (Scheme) (define (A220400 n) (let loop ((s 0) (begin 1) (end 1) (sum 1)) (cond ((> begin (/ n 2)) s) ((< sum n) (loop s begin (+ end 2) (+ sum end 2))) ((> sum n) (loop s (+ begin 2) end (- sum begin))) (else (loop (+ 1 s) (+ begin 2) end (- sum begin)))))) ;; _Antti Karttunen_, Dec 27 2017 %o A220400 (PARI) a(n) = if(n==0, return(0)); my(d = divisors(n)); (#d + 1) \ 2 - sum(i = 2, (#d + 1) \ 2, (n / d[i] - d[i]) % 2) - 1 \\ _David A. Corneth_, Dec 27 2017 %Y A220400 Cf. A069283 (even numbers lead to this sequence). %Y A220400 Cf. A297160 (positions of records). %K A220400 nonn %O A220400 0,17 %A A220400 _Carl Najafi_, Dec 13 2012 %E A220400 More terms from _Antti Karttunen_, Dec 27 2017