OFFSET
0,1
COMMENTS
65537 is the 4th Fermat prime, A019434(4).
LINKS
A. Karttunen, Table of n, a(n) for n = 0..65537
PROG
(MIT Scheme, using fixnum-implementation of jacobi-symbol that works only up to 2^25-1 = 33554431):
(define (A165471 n) (legendre-symbol n 65537))
(define legendre-symbol jacobi-symbol)
(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)=kronecker(n, 65537) \\ Charles R Greathouse IV, Oct 31 2011
(Sage)
def A165471(n): return legendre_symbol(n, 65537)
[A165471(n) for n in range(82)] # Peter Luschny, Aug 09 2012
CROSSREFS
KEYWORD
sign,mult,easy
AUTHOR
Antti Karttunen, Sep 21 2009
STATUS
approved