# How can I know the number of solutions of an equation involving prime numbers?

How could I calculate the number of prime numbers of a certain form (like, for example, $4n+1$ or $4p+1$ being $p$ prime) lower than a given input $N$? Would there be any way to plot it respect to that $N$?

Thank you!

Number of primes

n = 10000;
primes = Prime[Range[PrimePi[n]]];

(* 4n + 1 *)
pickQ = Divisible[primes - 1, 4];
Length@ Pick[primes, pickQ]

(* 4p + 1 with p prime *)
pickQ2 = PrimeQ[(primes - 1) / 4];
Length@ Pick[primes, pickQ2]


Plots

(* 4n + 1 *)
nbprimes[n_] := With[{primes = Prime[Range[PrimePi[n]]]},
Length@ Pick[primes, Divisible[primes - 1, 4]]
];

DiscretePlot[nbprimes[n], {n, 1, 100}]


(* 4p + 1 with p prime *)
nbprimes2[n_] := With[{primes = Prime[Range[PrimePi[n]]]},
Length@ Pick[primes, PrimeQ[(primes - 1)/4]]
];

DiscretePlot[nbprimes2[n], {n, 1, 100}]