OFFSET
1,1
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..199 (data obtained from A048891 and A052013; sorted by Amiram Eldar Sep 05 2024)
FORMULA
EXAMPLE
The 10th prime is 29. Since 10 divides 29+1 = 30, 29 is in the sequence.
The 12th prime is 37. Since 12 divides 37-1 = 36, 37 is in the sequence.
MAPLE
isA162567 := proc(p) RETURN ( (p-1) mod numtheory[pi](p) = 0 or (p+1) mod numtheory[pi](p) = 0 ) ; end: for n from 1 to 50000 do p := ithprime(n) ; if isA162567(p) then printf("%d, ", p) ; fi; od: # R. J. Mathar, Jul 30 2009
with(numtheory): a := proc (n) if `mod`(ithprime(n)-1, pi(ithprime(n))) = 0 or `mod`(ithprime(n)+1, pi(ithprime(n))) = 0 then ithprime(n) else end if end proc: seq(a(n), n = 1 .. 250000); # Emeric Deutsch, Jul 31 2009
MATHEMATICA
Select[Prime[Range[11000000]], Or@@Divisible[{#-1, #+1}, PrimePi[#]]&] (* Harvey P. Dale, Sep 08 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 06 2009
EXTENSIONS
a(10)-a(35) from Donovan Johnson, Jul 29 2009
STATUS
approved