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

%I #13 Mar 18 2019 21:51:21

%S 1,4,7,2,5,8,11,6,1,4,7,2,5,8,11,6,9,12,15,10,5,8,11,6,1,4,7,2,5,8,11,

%T 6,9,12,15,10,13,16,19,14,9,12,15,10,5,8,11,6,9,12,15,10,5,8,11,6,1,4,

%U 7,2,5,8,11,6,9,12,15,10,13,16,19,14,9,12,15,10,13,16,19,14,17,20,23

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

%C a(n) > 0 for n > 2 and it seems that a(n)/log(n) is bounded: a(n) < 4*log(n) for n sufficiently large. Does lim_{n->infinity} a(n)/log(n) exist?

%H G. C. Greubel, <a href="/A071932/b071932.txt">Table of n, a(n) for n = 3..5000</a>

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

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

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

%Y Cf. A071933, A071934.

%K easy,nonn

%O 3,2

%A _Benoit Cloitre_, Jun 14 2002