login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A275534 Number of primes of the form x^2 + y^2 less than or equal to 2*n^2. 1
1, 2, 4, 5, 7, 9, 12, 15, 18, 22, 25, 29, 33, 37, 43, 46, 51, 56, 62, 68, 75, 79, 86, 93, 102, 107, 114, 119, 127, 136, 143, 150, 160, 169, 179, 184, 195, 206, 215, 223, 233, 242, 254, 264, 274, 285, 297, 307, 318, 330, 339, 350, 362, 376, 386, 400, 415, 428, 441, 452, 465, 483, 498, 510, 525, 541 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Number of terms in A002313 that are less than A001105(n).

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

Cf. A001105, A002313.

Sequence in context: A062428 A250000 A056833 * A069355 A212661 A288511

Adjacent sequences:  A275531 A275532 A275533 * A275535 A275536 A275537

KEYWORD

nonn

AUTHOR

William Boyles, Jul 31 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 19 00:36 EDT 2018. Contains 316327 sequences. (Running on oeis4.)