The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A163976 prime(n) -(-1)^(n-th nonprime). 1
1, 4, 4, 6, 10, 14, 16, 18, 22, 30, 30, 36, 40, 44, 46, 52, 60, 60, 68, 70, 72, 78, 84, 88, 98, 100, 102, 108, 108, 112, 126, 132, 136, 138, 150, 150, 158, 162, 166, 174, 178, 182, 190, 192, 196, 200, 210, 224, 226, 228, 234, 238, 240, 250, 258, 262, 270, 270, 276, 282, 282 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = A000040(n) -(-1)^A141468(n) .
EXAMPLE
a(1) = 2-(-1)^0 = 1. a(2) = 3-(-1)^1=4.
MATHEMATICA
nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n];
Table[Prime[n + 1] - (-1)^(nonPrime[n]), {n, 0, 50}] (* G. C. Greubel, Aug 24 2017 *)
Module[{nn=200, np, pr, len}, np=Select[Range[0, nn], !PrimeQ[#]&]; len= Length[ np]; #[[1]]-(-1)^#[[2]]&/@Thread[{Prime[Range[len]], np}]] (* Harvey P. Dale, Jan 24 2021 *)
CROSSREFS
Sequence in context: A098052 A098530 A213379 * A213383 A213425 A213426
KEYWORD
nonn
AUTHOR
EXTENSIONS
Entries checked by R. J. Mathar, Oct 10 2009
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 June 10 19:30 EDT 2024. Contains 373280 sequences. (Running on oeis4.)