OFFSET
1,2
COMMENTS
In the S.-H. Cha reference this is function fog_3(n).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..8192
S.-H. Cha, On Parity based Divide and Conquer Recursive Functions, International Conference on Computer Science and Applications, San Francisco, USA, 24-26 October 2012
MAPLE
a:= proc(n) option remember; 1+ `if`(n=1, 0, `if`(n<=3, 1,
`if`(irem(n, 3, 'r')=0, a(r), a(r)+a(r+1))))
end:
seq (a(n), n=1..80); # Alois P. Heinz, Aug 23 2012
MATHEMATICA
a[n_] := a[n] = If[n < 3, n, {q, r} = QuotientRemainder[n, 3];
Switch[r, 0, a[q] + 1, 1|2, a[q] + a[q+1] + 1]];
Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Apr 24 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Sung-Hyuk Cha, Aug 20 2012
STATUS
approved