OFFSET
1,4
COMMENTS
LINKS
FORMULA
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]; a[n_] := a[n] = If[n == 1, n - 1, 2 a[f@ n] + Boole[Divisible[n, 3]]]; Array[a, 67] (* Michael De Vlieger, Sep 22 2017 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 20 2017
STATUS
approved