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.

A369111 a(n) is the number of primes p less than or equal to 10^n such that p+2 has only prime factors congruent to -1 modulo 4.

Original entry on oeis.org

2, 12, 65, 388, 2708, 19969, 155369, 1250182, 10345920, 87545946, 753285178, 6571105993
Offset: 1

Views

Author

Stefano Spezia, Jan 13 2024

Keywords

Examples

			a(2) = 12 since there are 12 primes p less than or equal to 10^2 such that p+2 has only prime factors congruent to -1 modulo 4 (cf. A369105): 5, 7, 17, 19, 29, 31, 41, 47, 61, 67, 79, 97.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Length[Select[Prime[Range[10^n]], PrimeQ[f=First/@FactorInteger[#+2]] == Table[True, {j,PrimeNu[#+2]}] && Mod[f,4] == Table[3, {m,PrimeNu[#+2]}] && #<=10^n &]]; Array[a,10]
  • PARI
    is1(n) = {my(p = factor(n)[, 1]); for(i = 1, #p, if(p[i] % 4 == 1, return(0))); 1;};
    lista(nmax) = {my(c = 0, pow = 10, n = 1, nm = nmax + 1); forprime(p = 3, , if(p > pow, print1(c, ", "); pow *= 10; n++; if(n == nm, break)); if(is1(p+2), c++));} \\ Amiram Eldar, Jun 03 2024

Extensions

a(11)-a(12) from Amiram Eldar, Jun 03 2024