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.

A080147 Positions of primes of the form 4*k+1 (A002144) among all primes (A000040).

Original entry on oeis.org

3, 6, 7, 10, 12, 13, 16, 18, 21, 24, 25, 26, 29, 30, 33, 35, 37, 40, 42, 44, 45, 50, 51, 53, 55, 57, 59, 60, 62, 65, 66, 68, 70, 71, 74, 77, 78, 79, 80, 82, 84, 87, 88, 89, 97, 98, 100, 102, 104, 106, 108, 110, 112, 113, 116, 119, 121, 122, 123, 126, 127, 130, 134, 135
Offset: 1

Views

Author

Antti Karttunen, Feb 11 2003

Keywords

Comments

The asymptotic density of this sequence is 1/2 (by Dirichlet's theorem). - Amiram Eldar, Mar 01 2021

Examples

			7 is in the sequence because the 7th prime, 17, is of the form 4k+1.
4 is not in the sequence because the 4th prime, 7, is not of the form 4k+1.
		

Crossrefs

Almost complement of A080148 (1 is excluded from both).

Programs

  • Maple
    with(numtheory,ithprime); pos_of_primes_k_mod_n(300,1,4);
    pos_of_primes_k_mod_n := proc(upto_i,k,n) local i,a; a := []; for i from 1 to upto_i do if(k = (ithprime(i) mod n)) then a := [op(a),i]; fi; od; RETURN(a); end;
    with(Bits): for n from 1 to 135 do if (And(ithprime(n),2)=0) then print(n) fi od; # Gary Detlefs, Dec 26 2011
  • Mathematica
    Select[Range[135], Mod[Prime[#], 4] == 1 &] (* Amiram Eldar, Mar 01 2021 *)
  • PARI
    k=0;forprime(p=2,1e4,k++;if(p%4==1,print1(k", "))) \\ Charles R Greathouse IV, Dec 27 2011

Formula

A002144(n) = A000040(a(n)).
Numbers k such that prime(k) AND 2 = 0. - Gary Detlefs, Dec 26 2011