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.

Showing 1-4 of 4 results.

A296021 Number of primes of the form 4*k+1 <= 4*n+1.

Original entry on oeis.org

0, 1, 1, 2, 3, 3, 3, 4, 4, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11, 12, 12, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 17, 18, 18, 19, 19, 19, 20, 21, 21, 21, 21, 21, 21, 21, 21, 22, 23, 23, 24, 24, 24, 24, 25, 25, 25, 26, 26, 27, 28, 28
Offset: 0

Views

Author

Seiichi Manyama, Dec 02 2017

Keywords

References

  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 23.

Crossrefs

Programs

  • Mathematica
    a[n_]:=Length[Select[Range[n],PrimeQ[4#+1] &]]; Array[a,72,0] (* Stefano Spezia, May 01 2025 *)
  • Ruby
    require 'prime'
    def A(k, n)
      ary = []
      cnt = 0
      k.step(4 * n + k, 4){|i|
        cnt += 1 if i.prime?
        ary << cnt
      }
      ary
    end
    p A(1, 100)

A296020 Number of primes of the form 4*k+3 <= 4*n+3.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 5, 6, 6, 6, 7, 8, 8, 8, 9, 9, 10, 11, 11, 12, 13, 13, 13, 13, 13, 14, 15, 15, 15, 15, 15, 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 25, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 31, 31, 31
Offset: 0

Views

Author

Seiichi Manyama, Dec 02 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{nn=300,pr3},pr3=Table[If[PrimeQ[k]&&Mod[k,4]==3,1,0],{k,0,nn}];Table[Total[Take[pr3,4n+3]],{n,(nn-3)/4}]] (* Harvey P. Dale, Aug 10 2019 *)
  • Ruby
    require 'prime'
    def A(k, n)
      ary = []
      cnt = 0
      k.step(4 * n + k, 4){|i|
        cnt += 1 if i.prime?
        ary << cnt
      }
      ary
    end
    p A(3, 100)

A055028 Number of Gaussian primes of norm n.

Original entry on oeis.org

0, 0, 4, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Jun 09 2000

Keywords

Comments

These are the primes in the ring of integers a+bi, a and b rational integers, i = sqrt(-1).

Examples

			There are 8 Gaussian primes of norm 5, +-1 +- 2i and +-2 +- i, but only two inequivalent ones (2 +- i).
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A16.
  • L. W. Reid, The Elements of the Theory of Algebraic Numbers, MacMillan, NY, 1910, see Chap. V.

Crossrefs

Programs

  • Maple
    A055028 := proc(n::integer)
        local c,a,b ;
        c := 0 ;
        for a from -n to n do
            if issqr(n-a^2) then
                b := sqrt(n-a^2) ;
                if GaussInt[GIprime](a+b*I) and a^2+b^2=n then
                    if b = 0 then
                        c := c+1 ; # a+i*b and a-i*b
                    else
                        c := c+2 ; # a+i*b and a-i*b
                    end if;
                end if;
            end if;
        end do:
        c ;
    end proc:
    seq( A055028(n),n=0..50) ; # R. J. Mathar, Jul 22 2021
  • Mathematica
    a[n_ /; PrimeQ[n] && Mod[n, 4] == 1] = 8; a[2] = 4; a[n_ /; (p = Sqrt[n]; PrimeQ[p] && Mod[p, 4] == 3)] = 4; a[] = 0; Table[ a[n], {n, 0, 100}] (* _Jean-François Alcover, Jul 30 2013, after Franklin T. Adams-Watters *)

Formula

a(n) = 4 * A055029(n). - Franklin T. Adams-Watters, May 05 2006

Extensions

More terms from Reiner Martin, Jul 20 2001

A091100 Number of Gaussian primes whose norm is less than 10^n.

Original entry on oeis.org

16, 100, 668, 4928, 38404, 313752, 2658344, 23046512, 203394764, 1820205436, 16472216912, 150431552012, 1384262129028, 12819767598972, 119378281788240, 1116953361826164
Offset: 1

Views

Author

T. D. Noe, Dec 19 2003

Keywords

Crossrefs

Cf. A091098 (number of primes of the form 4k+1 less than 10^n), A091099 (number of primes of the form 4k+3 less than 10^n), A091101, A091102.
Cf. A091134 (number of Gaussian primes whose modulus is less than 10^n).

Programs

  • Mathematica
    Table[lim2=10^n; lim1=Floor[Sqrt[lim2]]; cnt=0; Do[If[x^2+y^2True], cnt++ ], {x, -lim1, lim1}, {y, -lim1, lim1}]; cnt, {n, 6}]

Formula

a(2n) = 8*A091098(2n) + 4*A091099(n) + 4.
a(n) ~ 4 Li(10^n) ~ k/n * 10^n, where k = 4/log(10) = 1.737.... - Charles R Greathouse IV, Oct 24 2012

Extensions

a(10)-a(16) from Seiichi Manyama using the data in A091098, Dec 03 2017
Showing 1-4 of 4 results.