OFFSET
1,1
FORMULA
n's such that (prime_n - sigma(n))== 1 (mod n); A000040(n)-A000203(n)==1 (mod n). - Robert G. Wilson v, Nov 09 2005
EXAMPLE
The 42nd prime is 181. The divisors of 42 are 1, 2, 3, 6, 7, 14, 21, 42 and their sum is 96. 181-96 = 85. 85 = 1 mod 42. So 42 is a term.
MATHEMATICA
Select[Range[10^8], Mod[Prime[ # ] - Plus @@ Divisors[ # ], # ] == 1 &] (* Ray Chandler, Nov 09 2005 *)
fQ[n_] := Mod[Prime[n] - DivisorSigma[1, n], n] == 1; t = {}; Do[ If[ fQ[n], AppendTo[t, n]], {n, 50000000}]; t (* Robert G. Wilson v *)
PROG
(PARI) n=0; forprime(p=1, 1e9, n++; if((p - sigma(n)) % n == 1, print1(n, ", "))) \\ Amiram Eldar, Jan 19 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray G. Opao, Nov 07 2005
EXTENSIONS
a(22) and a(23) from Ray Chandler and Robert G. Wilson v, Nov 09 2005
a(24)-a(33) from Amiram Eldar, Jan 19 2019
STATUS
approved