OFFSET
0,3
LINKS
FORMULA
a(n) + A292592(n) = n.
MATHEMATICA
f[n_] := f[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; g[n_] := g[n] = If[n <= 2, n - 1, 2 g[f@ n] + Boole[Mod[n, 3] == 1]]; h[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ If[n == 0, 1, Prime[#] Product[Prime[m]^(Map[ Ceiling[ (Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]][[-m]]), {m, #}] &[DigitCount[n, 2, 1]]]; Array[g@ h@ # &, 92, 0] (* Michael De Vlieger, Sep 22 2017 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 20 2017
STATUS
approved