OFFSET
1,1
EXAMPLE
For n=1, nonprime(prime(1)) - (-1)^1 = nonprime(2)+1 = 1+1 = 2 (prime), so a(1)=2.
For n=2, nonprime(prime(2)) - (-1)^2 = nonprime(3)-1 = 4-1 = 3(prime), so a(2)=3.
For n=3, nonprime(prime(3)) - (-1)^3 = nonprime(5)+1 = 8+1 = 9 (composite).
For n=4, nonprime(prime(4)) - (-1)^4 = nonprime(7)-1 = 10-1 = 9 (composite).
For n=5, nonprime(prime(5)) - (-1)^5 = nonprime(11)+1 = 16+1 = 17 (prime), so a(3)=17, etc.
MAPLE
A141468 := proc(n) if n <= 2 then n-1 ; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) ; fi; od; fi: end: for n from 1 to 400 do p := A141468(ithprime(n))-(-1)^n ; if isprime(p) then printf("%d, ", p); fi; od: # R. J. Mathar, Aug 14 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jan 06 2009
EXTENSIONS
Corrected and extended by R. J. Mathar, Aug 14 2009
STATUS
approved