login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A295996 One quarter of number of Gaussian primes whose norm is 4*n+1 or less. 5
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
Eric Weisstein's World of Mathematics, Gaussian Prime
EXAMPLE
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.
PROG
(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)
CROSSREFS
Sequence in context: A069211 A368152 A242822 * A240675 A072152 A199015
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Dec 02 2017
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 16:45 EDT 2024. Contains 371989 sequences. (Running on oeis4.)