cp's OEIS Frontend

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.

A166051 Nonsquare integers of the form 4n+1 for which Sum_{i=1..u} J(i,4n+1) is never negative for any u in range [1,(2n)], where J(i,k) is the Jacobi symbol.

This page as a plain text file.
%I A166051 #12 Apr 05 2020 14:56:02
%S A166051 5,13,21,37,85,93,165
%N A166051 Nonsquare integers of the form 4n+1 for which Sum_{i=1..u} J(i,4n+1) is never negative for any u in range [1,(2n)], where J(i,k) is the Jacobi symbol.
%C A166051 Conjecture: There are no more terms after 165. (Checked up to A016813(290511) = 1162045.) If this is true, then also 5, 13 and 37 are only 4k+1 primes in A080114.
%o A166051 (MIT Scheme with macro MATCHING-POS by AK):
%o A166051 (define (A166051 n) (A016813 (index_for_a166051 n)))
%o A166051 (define index_for_a166051 (MATCHING-POS 1 0 (lambda (n) (let ((w (A016813c n)) (hp (A005843 n))) (let loop ((i 1) (s 1)) (cond ((< s 0) #f) ((>= i hp) (zero? s)) (else (loop (1+ i) (+ s (jacobi-symbol (1+ i) w))))))))))
%o A166051 (Sage)
%o A166051 def is_what(n, k):
%o A166051     s = 0
%o A166051     for i in (1..k):
%o A166051         s += jacobi_symbol(i, n)
%o A166051         if s < 0: return False
%o A166051     return not is_square(n)
%o A166051 def A166051_list(n):
%o A166051     return [m for m in range(1, n + 1, 4) if is_what(m, m // 2)]
%o A166051 A166051_list(1000) # _Peter Luschny_, Aug 08 2012
%Y A166051 Setwise difference of A016754 and A166049.
%K A166051 nonn
%O A166051 1,1
%A A166051 _Antti Karttunen_, Oct 08 2009