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.

A100672 a(1) = 1; thereafter, a(n) = 1 if n-th prime is 3 mod 4, 0 if n-th prime is 1 mod 4.

This page as a plain text file.
%I A100672 #42 Feb 16 2025 08:32:55
%S A100672 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 A100672 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 A100672 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 A100672 a(1) = 1; thereafter, a(n) = 1 if n-th prime is 3 mod 4, 0 if n-th prime is 1 mod 4.
%C A100672 Second least-significant bit in the binary expansion of the n-th prime.
%C A100672 a(n)=1 iff prime(n) is a member of A045326 (equivalently for n>1, iff prime(n)-3 is divisible by 4).
%H A100672 Amiram Eldar, <a href="/A100672/b100672.txt">Table of n, a(n) for n = 1..10000</a>
%H A100672 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Fermats4nPlus1Theorem.html">Fermat's 4n Plus 1 Theorem</a>.
%H A100672 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GaussianPrime.html">Gaussian Prime</a>.
%F A100672 a(n) = 1-A098033(n), n>1. - Steven G. Johnson (stevenj(AT)math.mit.edu), Sep 18 2008
%F A100672 a(n) = floor(prime(n)/2) mod 2. - _Alois P. Heinz_, Jul 16 2024
%e A100672 a(2)=1 because prime(2)=11_2 (in binary; decimal = 3_10) and its 2^1 bit is 1.
%e A100672 a(3)=0 because prime(3)=101_2 (in binary; decimal = 5_10) and its 2^1 bit is 0.
%p A100672 A100672 := proc(n)
%p A100672         if n = 1 then
%p A100672                 1 ;
%p A100672         else
%p A100672                 ((ithprime(n) mod 4)-1)/2;
%p A100672         end if;
%p A100672 end proc: # _R. J. Mathar_, Oct 06 2011
%t A100672 Table[Reverse[RealDigits[Prime[k], 2][[1]]][[2]], {k, 1, 128}]
%o A100672 (PARI) for(k=1,105,print1( bittest(prime(k), 1), ", ")) \\ _Washington Bomfim_, Jan 18 2011
%o A100672 (Python)
%o A100672 from sympy import prime
%o A100672 def A100672(n): return int(prime(n)>>1&1) # _Chai Wah Wu_, Jun 23 2023
%Y A100672 Cf. A000040, A045326, A002144, A002145, A039702.
%Y A100672 RUNS transform is essentially A091237.
%K A100672 base,nonn,easy
%O A100672 1,1
%A A100672 Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 06 2004
%E A100672 Edxited by _N. J. A. Sloane_, Jan 11 2025