login
a(n) = n - A325967(n).
4

%I #8 Jun 02 2019 23:42:52

%S 1,2,3,4,5,1,7,8,9,9,11,11,13,13,11,16,17,17,19,19,21,21,23,23,25,23,

%T 27,1,29,29,31,32,29,33,35,36,37,37,39,39,41,41,43,43,41,43,47,47,49,

%U 50,47,49,53,53,55,55,57,57,59,59,61,61,63,64,65,65,67,67,65,69,71,71,73,73,75,73,77,77,79,79,81,81,83,83,85,83,83

%N a(n) = n - A325967(n).

%H Antti Karttunen, <a href="/A325959/b325959.txt">Table of n, a(n) for n = 1..25000</a>

%H <a href="/index/Si#SIGMAN">Index entries for sequences related to sigma(n)</a>

%F a(n) = n - A325967(n).

%F a(n) = A033879(n) + A325969(n).

%F For all n, a(n) <= A325976(n).

%o (PARI)

%o A325967aux(n, ds, s, ms, divs, from=1) = if(1==gcd((s-ds)-n,n-ds), return(ds), for(i=from, #divs, if(ds+divs[i] >= ms, return(ms), ms = min(ms,A325967aux(n, ds+divs[i], s, ms, divs, i+1)))); (ms));

%o A325967(n) = if(1==gcd(n, sigma(n)), 0, my(divs = List(divisors(n)), s=sigma(n), ms=2*s); fordiv(n,d, if(d>=ms, return(ms), listpop(divs,1); ms = min(ms,A325967aux(n, d, s, ms, divs)))); (ms));

%o A325959(n) = (n - A325967(n));

%Y Cf. A000203, A325967, A325968, A325969, A325976.

%K nonn

%O 1,2

%A _Antti Karttunen_, Jun 01 2019