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”).

a(n) = p(n) - sigma(n), where p(n) is the least prime greater than sigma(n).
3

%I #16 Nov 07 2017 18:30:40

%S 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,

%T 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,

%U 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

%N a(n) = p(n) - sigma(n), where p(n) is the least prime greater than sigma(n).

%H Antti Karttunen, <a href="/A072918/b072918.txt">Table of n, a(n) for n = 1..16384</a>

%F a(n) = A013632(A000203(n)). - _Antti Karttunen_, Nov 07 2017

%e phi(4) = 7 and the least prime > 7 is 11; hence a(4) = 11 - 7 = 4.

%t ps[n_]:=Module[{sn=DivisorSigma[1,n]}, NextPrime[sn]-sn]; ps/@Range[100] (* _Harvey P. Dale_, Feb 02 2011 *)

%o (PARI) A072918(n) = (nextprime(1+sigma(n)) - sigma(n)); \\ _Antti Karttunen_, Nov 07 2017

%Y Cf. A000203, A013632, A202111.

%K easy,nonn

%O 1,2

%A _Joseph L. Pe_, Aug 11 2002