login
A364288
a(n) = n - A243071(n).
8
1, 1, 0, 2, -2, 0, -8, 4, 4, -4, -20, 0, -50, -16, 2, 8, -110, 8, -236, -8, -8, -40, -488, 0, 14, -100, 18, -32, -994, 4, -2016, 16, -28, -220, 8, 16, -4058, -472, -86, -16, -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
OFFSET
1,4
LINKS
FORMULA
a(n) = A364258(A243071(n)).
For n >= 1, a(2*n) = 2*a(n).
For n >= 0, a(A007283(n)) = 0.
MATHEMATICA
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 *)
PROG
(PARI)
A064989(n) = { my(f=factor(n>>valuation(n, 2))); for(i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f); };
A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n)))));
A364288(n) = (n-A243071(n));
CROSSREFS
Cf. A243071, A364256 [= gcd(n,a(n))], A364258.
Cf. A007283 (positions of 0's, conjectured), A364289 (positions of terms <= 0), A364290 (of terms > 0), A364291 (of terms >= 0).
Cf. also A364253.
Sequence in context: A137456 A337710 A248948 * A009187 A009803 A009615
KEYWORD
sign
AUTHOR
Antti Karttunen, Jul 25 2023
STATUS
approved