OFFSET
1,3
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
Max Alekseyev, PARI/GP Scripts for Miscellaneous Math Problems (invphi.gp).
FORMULA
a(A007369(n)) = 0.
EXAMPLE
There are no integers such that sigma(x) = 2, so a(2) = 0.
There is a single integer, x = 2, such that sigma(x) = 3, so a(3) = 2.
There are 2 integers, x = 6 and 11, such that sigma(x)=12, their gcd is 1, so a(12) = 1.
MAPLE
A240667 := n -> igcd(op(select(k->sigma(k)=n, [$1..n]))):
seq(A240667(n), n=1..82); # Peter Luschny, Apr 13 2014
MATHEMATICA
a[n_] := GCD @@ Select[Range[n], DivisorSigma[1, #] == n&];
Array[a, 100] (* Jean-François Alcover, Jul 30 2018 *)
PROG
(PARI) sigv(n) = select(i->sigma(i) == n, vector(n, i, i));
a(n) = {v = sigv(n); if (#v == 0, 0, gcd(v)); }
(PARI) a(n) = my(s = invsigma(n)); if(#s, gcd(s), 0); \\ Amiram Eldar, Dec 19 2024, using Max Alekseyev's invphi.gp
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Apr 10 2014
STATUS
approved