A263390 a(3n) = n, otherwise a(n) = a(floor(2n/3)).
0, 0, 0, 1, 0, 1, 2, 0, 1, 3, 2, 0, 4, 1, 3, 5, 2, 0, 6, 4, 1, 7, 3, 5, 8, 2, 0, 9, 6, 4, 10, 1, 7, 11, 3, 5, 12, 8, 2, 13, 0, 9, 14, 6, 4, 15, 10, 1, 16, 7, 11, 17, 3, 5, 18, 12, 8, 19, 2, 13, 20, 0, 9, 21, 14, 6, 22, 4, 15, 23, 10, 1, 24, 16, 7, 25
Offset: 0
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..10000
Programs
-
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 *)
-
PARI
a(n)=if(n%3,a(2*n\3),n/3) \\ Charles R Greathouse IV, Apr 30 2016
Formula
a(n) = A163491(n+1) - 1. - Peter Munn, Nov 22 2020
Comments