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-5 of 5 results.

A066339 Number of primes p of the form 4m+1 with p <= n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11
Offset: 1

Views

Author

Sharon Sela (sharonsela(AT)hotmail.com), Jan 01 2002

Keywords

Comments

Asymptotic expansion: a(n) ~ pi(n)/2 ~ n/(2log(n)) (pi(n) is in sequence A000720).
Partial sums of A079260. - Reinhard Zumkeller, Feb 06 2014

Crossrefs

Programs

  • Haskell
    a066339 n = a066339_list !! (n-1)
    a066339_list = scanl1 (+) $ map a079260 [1..]
    -- Reinhard Zumkeller, Feb 06 2014
  • Mathematica
    Table[ Length[ Select[ Union[ Table[ Prime[ PrimePi[i]], {i, 2, n}]], Mod[ #, 4] == 1 & ]], {n, 2, 100} ]
  • PARI
    for(n=1,200,print1(sum(i=1,n,if((i*isprime(i)-1)%4,0,1)),","))
    

Formula

a(n) + A066490(n) = A000720(n) - 1 for n >= 2. - Jianing Song, Apr 28 2021

Extensions

More terms from Robert G. Wilson v, Jan 03 2002

A295996 One quarter of number of Gaussian primes whose norm is 4*n+1 or less.

Original entry on oeis.org

0, 3, 4, 6, 8, 8, 8, 10, 10, 12, 14, 14, 15, 17, 17, 19, 19, 19, 21, 21, 21, 21, 23, 23, 25, 27, 27, 29, 31, 31, 32, 32, 32, 32, 34, 34, 34, 36, 36, 38, 38, 38, 38, 40, 40, 42, 42, 42, 44, 46, 46, 46, 46, 46, 46, 46, 46, 48, 50, 50, 52, 52, 52, 52, 54, 54, 54, 56
Offset: 0

Views

Author

Seiichi Manyama, Dec 02 2017

Keywords

Examples

			The Gaussian primes whose norm is 9 or less;
      *        3i,
    *   *      -1+2i, 1+2i
  * *   * *    -2+i, -1+i, 1+i, 2+i
*           *  -3, 3
  * *   * *    -2-i, -1-i, 1-i, 2-i
    *   *      -1-2i, 1-2i
      *        -3i
               a(2) = 16/4 = 4.
		

Crossrefs

Programs

  • 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
    def A295996(n)
      ary1 = A(1, n)
      ary3 = A(3, Math.sqrt(n).to_i) + [0]
      [0] + (1..n).map{|i| 1 + 2 * ary1[i] + ary3[(Math.sqrt(4 * i + 1).to_i - 3) / 4]}
    end
    p A295996(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)

A340767 Number of primes p <= 6*n + 5 that are congruent to 2 modulo 3.

Original entry on oeis.org

2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 16, 17, 18, 18, 19, 19, 19, 20, 21, 22, 22, 23, 24, 24, 24, 24, 24, 25, 26, 27, 27, 28, 29, 30, 31, 31, 32, 32, 33, 33, 33, 34, 35, 35, 35, 35, 35, 36, 37, 38, 38, 38, 38, 39, 40, 40, 41, 41, 41, 42, 42
Offset: 0

Views

Author

Jianing Song, Apr 28 2021

Keywords

Examples

			There are 14 primes <= 6*16+5 = 101 that are congruent to 2 modulo 3, namely 2, 5, 11, 17, 23, 29, 41, 47, 53, 59, 71, 83, 89, 101, so a(16) = 14.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(i=1, 6*n+5, isprime(i) && (i%3==2))

Formula

a(n) = A340764(6*n+5).
a(n) = 1 + Sum_{k=0..n+1} A167020(k).

A307152 a(n) = floor((A002144(n)+19)/24).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 31 2019

Keywords

Comments

This sequence arises in several different contexts [Kramer].
The number of occurrences of k in the sequence is A296021(6*k) - A296021(6*k-6). - Robert Israel, Mar 31 2019
Original name was: "Floor( (q+19)/24 ) where q is a prime == 1 (mod 4)." - Robert Israel, Apr 07 2019

Crossrefs

Programs

  • Maple
    map(t -> floor((t+19)/24), select(isprime, [seq(i,i=1..1000,4)])); # Robert Israel, Mar 31 2019
  • Mathematica
    Table[Floor[(q + 19)/24], {q, Select[Range[1, 650, 4], PrimeQ]}] (* Michael De Vlieger, Mar 31 2019 *)
Showing 1-5 of 5 results.