OFFSET
1,1
COMMENTS
For n > 1, a(n)=0 if sigma(n) is odd. Sigma(n) is odd iff n is a square or twice a square. - Robert G. Wilson v, Oct 03 2001
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..479 (prepared from the b-file of A000230 whose data is from Thomas R. Nicely's website)
EXAMPLE
a(6) = 199 because 211 - 199 = 12 = sigma(6).
MAPLE
A000230 := proc(n) option remember; local i ; for i from 1 do if ithprime(i+1) -ithprime(i) = 2*n then return ithprime(i) ; end if; end do: end proc:
A192496 := proc(n) s := numtheory[sigma](n) ; if s = 1 then 2 ; elif type(s, 'odd') then 0; else A000230(s/2) ; end if; end proc:
for n from 1 do print(A192496(n)) ; end do: # R. J. Mathar, Jul 04 2011
MATHEMATICA
With[{s = Differences@ Prime@ Range[10^6]}, Array[Prime@ FirstPosition[s, DivisorSigma[1, #]][[1]] /. k_ /; ! IntegerQ@ k -> 0 &, 51]] (* Michael De Vlieger, Nov 23 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jul 02 2011
EXTENSIONS
Corrected by R. J. Mathar, Jul 04 2011
STATUS
approved