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”).
%I #13 Jul 25 2023 13:11:23
%S 1,1,0,2,-2,0,-8,4,4,-4,-20,0,-50,-16,2,8,-110,8,-236,-8,-8,-40,-488,
%T 0,14,-100,18,-32,-994,4,-2016,16,-28,-220,8,16,-4058,-472,-86,-16,
%U -8150,-16,-16340,-80,20,-976,-32720,0,26,28,-202,-200,-65482,36,-4,-64,-452,-1988,-131012,8,-262082,-4032,6,32,-58,-56
%N a(n) = n - A243071(n).
%H Antti Karttunen, <a href="/A364288/b364288.txt">Table of n, a(n) for n = 1..12288</a>
%F a(n) = A364258(A243071(n)).
%F For n >= 1, a(2*n) = 2*a(n).
%F For n >= 0, a(A007283(n)) = 0.
%t nn = 60; f[x_] := Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First[#], Last[#] ] &@ Transpose@ FactorInteger@ x; Do[a[n] = Which[n <= 2, n - 1, OddQ[n], 1 + 2 a[f[n]], True, 2 a[n/2] ], {n, nn}]; Array[# - a[#] &, nn] (* _Michael De Vlieger_, Jul 25 2023 *)
%o (PARI)
%o A064989(n) = { my(f=factor(n>>valuation(n,2))); for(i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f); };
%o A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n)))));
%o A364288(n) = (n-A243071(n));
%Y Cf. A243071, A364256 [= gcd(n,a(n))], A364258.
%Y Cf. A007283 (positions of 0's, conjectured), A364289 (positions of terms <= 0), A364290 (of terms > 0), A364291 (of terms >= 0).
%Y Cf. also A364253.
%K sign
%O 1,4
%A _Antti Karttunen_, Jul 25 2023