login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = Sum_{i=1..n} K(i,i+1), where K(x,y) is the Kronecker symbol (x/y).
3

%I #19 Apr 06 2019 04:09:30

%S 1,0,1,2,3,2,3,4,5,4,3,4,5,4,5,6,7,6,7,8,9,8,7,8,9,8,7,8,9,8,9,10,11,

%T 10,11,12,13,12,13,14,15,14,13,14,15,14,13,14,15,14,15,16,17,16,15,16,

%U 17,16,15,16,17,16,17,18,19,18,19,20,21,20,21,22,23,22,21,22,23,22,23

%N a(n) = Sum_{i=1..n} K(i,i+1), where K(x,y) is the Kronecker symbol (x/y).

%H G. C. Greubel, <a href="/A071933/b071933.txt">Table of n, a(n) for n = 1..5000</a>

%F a(n) = n/4 + O(n), asymptotically. [Perhaps O(n) should be o(n)? - _N. J. A. Sloane_, Mar 26 2019]

%F In fact we have a(n) = n/4 + O(log(n)). More precisely let c(n)=A037800(n) then we get a(8n)=2n+2+2c(n), a(8n+1)=2n+3+2c(n), a(8n+2)=2n+2+2c(n), a(8n+3)=2n+2+2c(n)+(-1)^n, a(8n+4)=2n+3+2c(n)+(-1)^n, a(8n+5)=2n+4+2c(n)+(-1)^n, a(8n+6)=2n+3+2c(n)+(-1)^n, a(8n+7)=2n+3+2c(n+1). - _Benoit Cloitre_, Mar 30 2019

%t Table[Sum[KroneckerSymbol[j, j+1], {j, 1, n}], {n, 1, 80}] (* _G. C. Greubel_, Mar 17 2019 *)

%o (PARI) for(n=1,100,print1(sum(i=1,n,kronecker(i,i+1)),","))

%o (Sage) [sum(kronecker_symbol(j,j+1) for j in (1..n)) for n in (1..80)] # _G. C. Greubel_, Mar 17 2019

%Y Cf. A071932, A071934.

%K easy,nonn

%O 1,4

%A _Benoit Cloitre_, Jun 14 2002