OFFSET
0,1
COMMENTS
Conjecture: a(2n) = 2*A165605(2n) and a(2n+1) = (2/3)*A165605(2n+1). - Antti Karttunen, Oct 05 2009. (If true, then implies also the truth of conjecture in A165462.)
LINKS
A. Karttunen, Table of n, a(n) for n = 0..21845
MATHEMATICA
Table[Sum[JacobiSymbol[i, 12n + 7], {i, 0, 4n + 2}], {n, 0, 100}] (* Indranil Ghosh, May 13 2017 *)
PROG
(MIT Scheme:)
(define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
(define jacobi-symbol fix:jacobi-symbol)
(define (fix:jacobi-symbol p q) (if (not (and (fix:fixnum? p) (fix:fixnum? q) (fix:= 1 (fix:and q 1)))) (error "fix:jacobi-symbol: args must be fixnums, and 2. arg should be odd: " p q) (let loop ((p p) (q q) (s 0)) (cond ((fix:zero? p) 0) ((fix:= 1 p) (fix:- 1 (fix:and s 2))) ((fix:= 1 (fix:and p 1)) (loop (fix:remainder q p) p (fix:xor s (fix:and p q)))) (else (loop (fix:lsh p -1) q (fix:xor s (fix:xor q (fix:lsh q -1)))))))))
(PARI) a(n) = sum(i=0, 4*n + 2, kronecker(i, 12*n + 7)); \\ Indranil Ghosh, May 13 2017
(Python)
from sympy import jacobi_symbol as J
def a(n): return sum([J(i, 12*n + 7) for i in range(4*n + 3)]) # Indranil Ghosh, May 13 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 06 2009
STATUS
approved