A284053 Relative of Hofstadter Q-sequence.
9, 20, 5, 5, 20, 9, 20, 5, 5, 20, 9, 5, 10, 10, 20, 9, 5, 15, 15, 40, 9, 10, 20, 15, 40, 9, 15, 25, 15, 40, 9, 20, 25, 15, 60, 9, 25, 25, 20, 60, 9, 25, 30, 25, 60, 9, 25, 40, 20, 60, 9, 30, 45, 20, 80, 9, 40, 35, 30, 80, 9, 45, 35, 30, 100, 9, 35, 55, 25, 80, 9, 35, 55, 35, 100
Offset: 1
Keywords
Links
- Nathan Fox, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A284053:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 9: elif n = 2 then 20: elif n = 3 then 5: elif n = 4 then 5: elif n = 5 then 20: elif n = 6 then 9: elif n = 7 then 20: elif n = 8 then 5: elif n = 9 then 5: elif n = 10 then 20: elif n = 11 then 9: elif n = 12 then 5: elif n = 13 then 10: elif n = 14 then 10: elif n = 15 then 20: else A284053(n-A284053(n-1)) + A284053(n-A284053(n-2)): fi: end:
-
Python
from functools import cache @cache def a(n): if n <= 0: return 0 if n < 16: return [9, 20, 5, 5, 20, 9, 20, 5, 5, 20, 9, 5, 10, 10, 20][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, Sep 20 2021
Comments