login
Number of integers k in range [n^2, ((n+1)^2)-1] for which the least number of squares that add up to k (A002828) is odd.
4

%I #6 Oct 05 2016 10:19:12

%S 0,2,2,4,5,5,7,7,9,10,10,13,12,15,16,15,18,19,20,20,24,21,25,26,26,27,

%T 30,30,31,33,33,33,37,37,38,40,42,41,43,44,46,46,48,47,51,50,51,55,53,

%U 56,57,58,61,61,64,61,63,66,69,65,68,71,73,70,74,75,76,77,79,79,81,85,80,86,85,85,89,90,91,91,92,95,95,98,95,100

%N Number of integers k in range [n^2, ((n+1)^2)-1] for which the least number of squares that add up to k (A002828) is odd.

%H Antti Karttunen, <a href="/A277191/b277191.txt">Table of n, a(n) for n = 0..512</a>

%F a(n) = Sum_{i=n^2 .. ((n+1)^2)-1} A000035(A002828(i)).

%F For all n >= 0, a(n) + A277192(n) = 2n+1.

%F For all n >= 1, a(n) = 1 + A277193(n).

%o (Scheme)

%o (define (A277191 n) (add (lambda (i) (A000035 (A002828 i))) (A000290 n) (+ -1 (A000290 (+ 1 n)))))

%o ;; Implements sum_{i=lowlim..uplim} intfun(i)

%o (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))

%Y Cf. A000035, A000290, A002828, A277192.

%Y After the initial zero, one more than A277193.

%K nonn

%O 0,2

%A _Antti Karttunen_, Oct 04 2016