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.

A160591 Indices of primes congruent to 5 modulo 12.

Original entry on oeis.org

3, 7, 10, 13, 16, 24, 26, 30, 33, 35, 40, 45, 51, 55, 57, 60, 62, 66, 71, 77, 79, 87, 89, 97, 98, 102, 104, 108, 113, 116, 119, 123, 126, 135, 137, 139, 140, 142, 148, 152, 158, 160, 162, 165, 170, 176, 178, 184, 186, 194, 196, 199, 201, 206, 209, 212, 218, 220, 223
Offset: 1

Views

Author

M. F. Hasler, May 21 2009

Keywords

Comments

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

Examples

			a(1) = 3 since the 3rd prime, A000040(3) = 5, is the first one to be equal to 5 (mod 12).
a(2) = 7 since the 7th prime, A000040(7) = 17, is the second one to be equal to 5 (mod 12).
		

Crossrefs

A116602 lists the even terms of this sequence, divided by 2.

Programs

  • Maple
    res:= NULL: p:= 2:
    for m from 2 to 1000 do
      p:= nextprime(p);
      if p mod 12 = 5 then res:= res, m fi;
    od:
    res; # Robert Israel, Dec 26 2016
  • Mathematica
    Select[{#, Prime[#]}& /@ Range[500], Mod[#[[2]], 12] == 5&] [[All, 1]] (* Jean-François Alcover, Mar 23 2019 *)
    Select[Range[300],Mod[Prime[#],12]==5&] (* Harvey P. Dale, Mar 18 2023 *)
  • PARI
    for(n=1,999, prime(n)%12==5 & print1(n","))

Formula

a(n) = A000720(A040117(n)).