login
A366860
a(0) = 0; a(n) = n - a(floor(a(n-1)/3)).
4
0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, 54, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63
OFFSET
0,3
COMMENTS
A variation on Hofstadter's G-sequence.
FORMULA
Conjecture: a(n) ~ c*n, where c = 1/(1 + 1/(3 + 1/(1 + 1/(3 + ...)))) = (sqrt(21) - 3)/2 = 0.79128784747792...
MATHEMATICA
a[0] = 0; a[n_] := a[n] = n - a[Floor[a[n - 1]/3]]; Array[a, 80, 0]
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A366860(n): return n-A366860(A366860(n-1)//3) if n else 0 # Chai Wah Wu, Nov 30 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Oct 26 2023
STATUS
approved