[go: up one dir, main page]

login
A239913
a(n) = n - Q(n), where Q(n) is Hofstadter's Q-sequence A005185.
3
0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 4, 5, 6, 5, 7, 7, 7, 8, 8, 9, 10, 11, 8, 11, 12, 11, 12, 13, 14, 11, 15, 16, 14, 14, 17, 17, 16, 18, 18, 18, 19, 19, 20, 21, 22, 23, 16, 25, 25, 21, 24, 27, 24, 25, 28, 25, 28, 27, 28, 29, 30, 23, 31, 34, 28, 32, 35, 30, 30, 34, 34, 33, 35
OFFSET
1,5
COMMENTS
Just as for A005185, it is not known if this sequence exists for all n.
FORMULA
For n >= 3, a(n) = a(a(n-1)+1) + a(a(n-2)+2) - a(n-1) - a(n-2) + n - 3. - Chai Wah Wu, Apr 13 2023
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A239913(n): return n-1 if n<=2 else A239913(a:=1+A239913(n-1))+A239913(b:=2+A239913(n-2))-a-b+n # Chai Wah Wu, Apr 13 2023
CROSSREFS
Cf. A005185.
Sequence in context: A029149 A080570 A163001 * A323701 A226591 A194223
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 09 2014
STATUS
approved