login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A072918
a(n) = p(n) - sigma(n), where p(n) is the least prime greater than sigma(n).
3
1, 2, 1, 4, 1, 1, 3, 2, 4, 1, 1, 1, 3, 5, 5, 6, 1, 2, 3, 1, 5, 1, 5, 1, 6, 1, 1, 3, 1, 1, 5, 4, 5, 5, 5, 6, 3, 1, 3, 7, 1, 1, 3, 5, 1, 1, 5, 3, 2, 4, 1, 3, 5, 7, 1, 7, 3, 7, 1, 5, 5, 1, 3, 4, 5, 5, 3, 1, 1, 5, 1, 2, 5, 13, 3, 9, 1, 5, 3, 5, 6, 1, 5, 3, 1, 5, 7, 1, 7, 5, 1, 5, 3, 5, 7, 5, 3, 2, 1, 6
OFFSET
1,2
LINKS
FORMULA
a(n) = A013632(A000203(n)). - Antti Karttunen, Nov 07 2017
EXAMPLE
phi(4) = 7 and the least prime > 7 is 11; hence a(4) = 11 - 7 = 4.
MATHEMATICA
ps[n_]:=Module[{sn=DivisorSigma[1, n]}, NextPrime[sn]-sn]; ps/@Range[100] (* Harvey P. Dale, Feb 02 2011 *)
PROG
(PARI) A072918(n) = (nextprime(1+sigma(n)) - sigma(n)); \\ Antti Karttunen, Nov 07 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Joseph L. Pe, Aug 11 2002
STATUS
approved