OFFSET
1,1
COMMENTS
a(n)=1 iff prime(n) is a member of A045326 (equivalently for n>1, iff prime(n)-3 is divisible by 4).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Fermat's 4n Plus 1 Theorem.
Eric Weisstein's World of Mathematics, Gaussian Prime.
FORMULA
a(n) = 1-A098033(n), n>1. - Steven G. Johnson (stevenj(AT)math.mit.edu), Sep 18 2008
a(n) = floor(prime(n)/2) mod 2. - Alois P. Heinz, Jul 16 2024
EXAMPLE
a(2)=1 because prime(2)=11_2 (in binary; decimal = 3_10) and its 2^1 bit is 1.
a(3)=0 because prime(3)=101_2 (in binary; decimal = 5_10) and its 2^1 bit is 0.
MAPLE
A100672 := proc(n)
if n = 1 then
1 ;
else
((ithprime(n) mod 4)-1)/2;
end if;
end proc: # R. J. Mathar, Oct 06 2011
MATHEMATICA
Table[Reverse[RealDigits[Prime[k], 2][[1]]][[2]], {k, 1, 128}]
PROG
(PARI) for(k=1, 105, print1( bittest(prime(k), 1), ", ")) \\ Washington Bomfim, Jan 18 2011
(Python)
from sympy import prime
def A100672(n): return int(prime(n)>>1&1) # Chai Wah Wu, Jun 23 2023
CROSSREFS
KEYWORD
base,nonn,easy
AUTHOR
Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 06 2004
STATUS
approved