OFFSET
1,2
LINKS
William Boyles, Table of n, a(n) for n = 1..1000
MATHEMATICA
nn = 66; Table[Count[Take[#, PrimePi[2 n^2]], k_ /; k > 0], {n, nn}] &@
SquaresR[2, Prime@ Range@ PrimePi[2 nn^2]] (* Michael De Vlieger, Aug 01 2016 *)
PROG
(C++)
#include <iostream>
#include <cmath>
using namespace std;
bool IsPrime(int a){
int i = 3;
if(a == 2)
{return true; }
if(a <= 1 || a%2 == 0)
{return false; }
else{
while(i <= sqrt(a)){
if(a%i == 0)
{return false; }
else
{i = i+2; }}
return true; }}
int main(){
int Max, FourKPlusOne;
int limit=25; //Number of terms
for(int TermNum=1; TermNum<=limit; TermNum++){
Max = 2*TermNum*TermNum;
int Term=1;
for(int counter3=1; counter3<=(Max-1)/4; counter3++){
FourKPlusOne=((4*(counter3))+1);
if(IsPrime(FourKPlusOne) == true && FourKPlusOne<=Max)
{Term++; }}
cout<<Term<<endl; }}
(PARI) a(n)=my(s); forprime(p=2, 2*n^2, if(p%4<3, s++)); s \\ Charles R Greathouse IV, Sep 02 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
William Boyles, Jul 31 2016
STATUS
approved