This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A162567 #31 Sep 07 2024 08:53:07 %S A162567 2,3,5,7,11,13,29,37,43,349,359,1087,1091,3079,8423,64579,64591,64601, %T A162567 64609,64661,64709,481043,481067,1304707,3523969,3524249,3524317, %U A162567 3524387,9558541,9559799,9560009,9560039,25874767,70115921,189962009 %N A162567 Primes p such that pi(p) divides p-1 and/or p+1, where pi(p) is the number of primes <= p. %H A162567 Robert G. Wilson v, <a href="/A162567/b162567.txt">Table of n, a(n) for n = 1..199</a> (data obtained from A048891 and A052013; sorted by Amiram Eldar Sep 05 2024) %F A162567 a(n) = A000040(A078931(n)). - _Alois P. Heinz_, Feb 20 2023 %e A162567 The 10th prime is 29. Since 10 divides 29+1 = 30, 29 is in the sequence. %e A162567 The 12th prime is 37. Since 12 divides 37-1 = 36, 37 is in the sequence. %p A162567 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 %p A162567 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 %t A162567 Select[Prime[Range[11000000]],Or@@Divisible[{#-1,#+1},PrimePi[#]]&] (* _Harvey P. Dale_, Sep 08 2012 *) %Y A162567 Union of A048891 and A052013. - _Michel Marcus_, Mar 04 2019 %Y A162567 Cf. A000040, A078931. %K A162567 nonn %O A162567 1,1 %A A162567 _Leroy Quet_, Jul 06 2009 %E A162567 a(10)-a(35) from _Donovan Johnson_, Jul 29 2009