OFFSET
0,7
COMMENTS
This sequence is the unique fixed point of the function (a(0), a(1), a(2), ...) |--> (0, a(0), a(1), 1, a(2), a(3), 2, a(4), a(5), ...) which interleaves the nonnegative integers with pairs of elements of a sequence.
Compare with A025480, the unique fixed point of the function (a(0), a(1), a(2), ...) |--> (0, a(0), 1, a(1), 2, a(2), ...) which interleaves the nonnegative integers between the elements of a sequence.
These are the nim-values for heaps of n beans in the game where you're allowed to take up to one-third of the beans in a heap.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = A163491(n+1) - 1. - Peter Munn, Nov 22 2020
MATHEMATICA
Nest[Append[#1, If[Mod[#2, 3] == 0, #2/3, #1[[Floor[2 #2/3] + 1]]]] & @@ {#, Length[#]} &, {0}, 75] (* Michael De Vlieger, Jul 09 2021 *)
PROG
(PARI) a(n)=if(n%3, a(2*n\3), n/3) \\ Charles R Greathouse IV, Apr 30 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lee A. Newberg, Apr 27 2016
STATUS
approved