OFFSET
1,1
COMMENTS
For n > 1, a(n)=0 if n is a perfect square (see A048691) because then tau(n) is odd.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
a(1) = 2; and for n > 1, if n = k^2, a(n) = 0, otherwise a(n) = A000230(A000005(n)/2). - Antti Karttunen, May 28 2017
EXAMPLE
a(12) = 23 because 29 - 23 = 6 = tau(12).
MAPLE
A000230 := proc(g) if g = 1 then return 2 ; elif type(g, 'odd') then return 0 ; else for i from 1 do if ithprime(i+1)-ithprime(i) = g then return ithprime(i) ; end if; end do: end if; end proc:
MATHEMATICA
Module[{nn=200, prs, dfs, thr}, prs=Prime[Range[nn]]; dfs=Differences[prs]; thr = DeleteDuplicatesBy[Thread[{Most[prs], dfs}], Last]; Join[{2}, Flatten[ Table[ Select[thr, #[[2]]==DivisorSigma[0, n]&], {n, 2, 80}]/.{}->{{0, 0}}, 1][[All, 1]]]] (* Harvey P. Dale, Mar 09 2021 *)
PROG
(PARI)
A000230(n) = { my(p=2); forprime(q=3, , if(q-p==2*n, return(p)); p=q); } \\ From Charles R Greathouse IV, Nov 20 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jul 02 2011
STATUS
approved