OFFSET
2,2
COMMENTS
This is a permutation of the nonnegative integers.
MAPLE
A000040 := proc(n) ithprime(n) ; end: A002808 := proc(n) local a; if n = 1 then 4; else for a from A002808(n-1)+1 do if not isprime(a) then RETURN(a) ; fi ; od: fi ; end: A066246 := proc(n) local k ; if isprime(n) then 0 ; else for k from 1 do if A002808(k) = n then RETURN(k) ; fi ; od: fi ; end: A049084 := proc(n) if not isprime(n) then 0; else numtheory[pi](n) ; fi ; end: A139637 := proc(n) local k; if n = 2 then 1; elif n = 4 then 0 ; else if isprime(n) then k := A049084(n) ; A000040(k-1) ; else k := A066246(n) ; A002808(k-1) ; fi ; fi ; end: seq(A139637(n), n=2..160) ; # R. J. Mathar, May 12 2008
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 28 2008
EXTENSIONS
More terms from R. J. Mathar, May 12 2008
STATUS
approved