A080147 Positions of primes of the form 4*k+1 (A002144) among all primes (A000040).
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
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.
Links
- Zak Seidov, Table of n, a(n) for n = 1..10000
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
Numbers k such that prime(k) AND 2 = 0. - Gary Detlefs, Dec 26 2011
Comments