OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Mohammad Javaheri, Nikolai A. Krylov, Permutations with a distinct divisor property, arXiv:1904.04227 [math.GR], 2019.
EXAMPLE
If n=1, then p(1)-r(1)=2-0=2=a(1).
If n=2, then p(2)-r(2)=3-1=2=a(2).
If n=3, then p(3)-r(3)=5-4=1 (nonprime).
If n=4, then p(4)-r(4)=7-6=1 (nonprime).
If n=5, then p(5)-r(5)=11-8=3=a(3).
If n=6, then p(6)-r(6)=13-9=4 (composite).
If n=7, then p(7)-r(7)=17-10=7=a(4).
If n=8, then p(8)-r(8)=19-12=7=a(5).
If n=9, then p(9)-r(9)=23-14=9 (composite).
If n=10, then=p(10)-r(10)=29-15=14 (composite).
If n=11, then p(11)-r(11)=31-16=15 (composite).
If n=12, then p(12)-r(12)=37--18=19=a(6).
If n=13, then p(13)-r(13)=41-20=21 (composite).
If n=14, then p(14)-r(14)=43-21=22 (composite).
If n=15, then p(15)-r(15)=47-22=25 (composite).
If n=16, then p(16)-r(16)=53-24=29=a(7), etc.
MATHEMATICA
Block[{nn = 2000, p, r}, p = Prime@ Range@ PrimePi@ nn; r = Complement[Range[0, nn], p]; Select[Array[p[[#]] - r[[#]] &, Min[Length /@ {p, r}]], PrimeQ]] (* Michael De Vlieger, May 21 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Aug 14 2008
EXTENSIONS
Edited and extended by Ray Chandler, Aug 19 2008
STATUS
approved