login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Second least-significant bit in the binary expansion of the n-th prime.
8

%I #39 Jul 16 2024 17:03:27

%S 1,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,0,0,0,1,1,0,0,1,1,0,1,

%T 0,1,0,1,1,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,

%U 1,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1,1,0,0,0,1,1,1,1,1,1,1,0,0,1,0,1,0,1,0,1

%N Second least-significant bit in the binary expansion of the n-th prime.

%C a(n)=1 iff prime(n) is a member of A045326 (equivalently for n>1, iff prime(n)-3 is divisible by 4).

%H Amiram Eldar, <a href="/A100672/b100672.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Fermats4nPlus1Theorem.html">Fermat's 4n Plus 1 Theorem</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/GaussianPrime.html">Gaussian Prime</a>.

%F a(n) = 1-A098033(n), n>1. - Steven G. Johnson (stevenj(AT)math.mit.edu), Sep 18 2008

%F a(n) = floor(prime(n)/2) mod 2. - _Alois P. Heinz_, Jul 16 2024

%e a(2)=1 because prime(2)=11_2 (in binary; decimal = 3_10) and its 2^1 bit is 1.

%e a(3)=0 because prime(3)=101_2 (in binary; decimal = 5_10) and its 2^1 bit is 0.

%p A100672 := proc(n)

%p if n = 1 then

%p 1 ;

%p else

%p ((ithprime(n) mod 4)-1)/2;

%p end if;

%p end proc: # _R. J. Mathar_, Oct 06 2011

%t Table[Reverse[RealDigits[Prime[k], 2][[1]]][[2]], {k, 1, 128}]

%o (PARI) for(k=1,105,print1( bittest(prime(k), 1), ", ")) \\ _Washington Bomfim_, Jan 18 2011

%o (Python)

%o from sympy import prime

%o def A100672(n): return int(prime(n)>>1&1) # _Chai Wah Wu_, Jun 23 2023

%Y Cf. A000040, A045326, A002144, A002145.

%K base,nonn,easy

%O 1,1

%A Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 06 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 20 17:28 EDT 2024. Contains 376075 sequences. (Running on oeis4.)