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!)
A242096 a(n) = (n mod 2) * pi( ceiling(n/2)-1 ), where pi is the prime counting function (A000720). 1
0, 0, 0, 0, 0, 1, 0, 2, 0, 2, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, 4, 0, 5, 0, 5, 0, 6, 0, 6, 0, 6, 0, 6, 0, 7, 0, 7, 0, 8, 0, 8, 0, 8, 0, 8, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 10, 0, 10, 0, 11, 0, 11, 0, 11, 0, 11, 0, 11, 0, 11, 0, 12, 0, 12, 0, 12, 0, 12 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,8
COMMENTS
Start at 0 on the real line and make a continuous clockwise spiral through the integer points: 0 -> 1 -> -1 -> 2 -> -2 -> 3 -> -3, etc. a(n) gives the number of primes on the line strictly between the point after the n-th step of the spiral and 0 (see example).
LINKS
FORMULA
a(n) = (n mod 2) * pi( ceiling(n/2)-1 ).
EXAMPLE
Table 1:
n-th step: |0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ...
position: |0, 1,-1, 2,-2, 3,-3, 4,-4, 5, -5, 6, -6, 7, -7, 8, ...
a(n): |0, 0, 0, 0, 0, 1, 0, 2, 0, 2, 0, 3, 0, 3, 0, 4, ...
Example 1: a(5) = 1; After the 5th step we are at position +3 on the line and there is exactly one prime between 3 and 0.
• • •
• •
• • • • •
• • • •
• • • • • •
_.___.___.___.___.___.___.___.___.___•___•___.___.___.___.___.___.___.___._
-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9
• • • •
• • • •
• •
• •
Example 2: a(8) = 0; After the 8th step we are at position -4 on the line and there are no (positive) primes between -4 and 0. In general, a(2n)=0.
• • • •
• •
• • • • •
• • • •
• • • • • • •
• • • • • •
• • • • • • • •
_.___.___.___.___.___.___.___.___.___•___•___.___.___.___.___.___.___.___._
-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9
• • • • • • • •
• • • • • •
• • • • • •
• • • • • • •
• • • •
• • • • • • •
• •
• • • •
MAPLE
with(numtheory): A242096:=n->(n mod 2)*pi(ceil(n/2)-1): seq(A242096(n), n=0..100);
MATHEMATICA
Table[Mod[n, 2] PrimePi[Ceiling[n/2] - 1], {n, 0, 100}]
PROG
(PARI) vector(100, n, ((n-1)%2)*primepi(ceil((n-1)/2)-1)) \\ Derek Orr, Aug 14 2014
CROSSREFS
Cf. A000720.
Sequence in context: A359495 A053399 A322996 * A284965 A274101 A117773
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Aug 14 2014
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 September 15 08:13 EDT 2024. Contains 375932 sequences. (Running on oeis4.)