A284054 Relative of Hofstadter Q-sequence.
7, 26, 8, 8, 8, 8, 8, 26, 7, 8, 16, 16, 16, 16, 16, 26, 7, 16, 24, 8, 16, 24, 8, 26, 7, 24, 16, 24, 24, 16, 24, 52, 7, 16, 48, 8, 24, 32, 24, 52, 7, 48, 8, 8, 48, 32, 16, 78, 7, 8, 16, 16, 48, 40, 24, 78, 7, 16, 24, 16, 72, 32, 24, 104, 7, 24, 24, 16, 96, 40, 24, 130, 7, 24, 32
Offset: 1
Keywords
Links
- Nathan Fox, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A284054:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 7: elif n = 2 then 26: elif n = 3 then 8: elif n = 4 then 8: elif n = 5 then 8: elif n = 6 then 8: elif n = 7 then 8: elif n = 8 then 26: elif n = 9 then 7: elif n = 10 then 8: elif n = 11 then 16: elif n = 12 then 16: elif n = 13 then 16: elif n = 14 then 16: elif n = 15 then 16: elif n = 16 then 26: else A284054(n-A284054(n-1)) + A284054(n-A284054(n-2)): fi: end:
-
Python
from functools import lru_cache @lru_cache(maxsize=None) def a(n): if n <= 0: return 0 if n < 17: return [7, 26, 8, 8, 8, 8, 8, 26, 7, 8, 16, 16, 16, 16, 16, 26][n-1] return a(n - a(n-1)) + a(n - a(n-2)) print([a(n) for n in range(1, 76)]) # Michael S. Branicky, Jul 26 2021
Comments