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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

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

Keywords

Comments

Second least-significant bit in the binary expansion of the n-th prime.
a(n)=1 iff prime(n) is a member of A045326 (equivalently for n>1, iff prime(n)-3 is divisible by 4).

Examples

			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.
		

Crossrefs

RUNS transform is essentially A091237.

Programs

  • 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}]
  • 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

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

Extensions

Edxited by N. J. A. Sloane, Jan 11 2025