[go: up one dir, main page]

login
A283883
Relative of Hofstadter Q-sequence: a(n) = max(0, n+117) for n <= 0; a(n) = a(n-a(n-1)) + a(n-a(n-2)) for n > 0.
2
3, 118, 119, 5, 120, 6, 7, 121, 123, 10, 8, 123, 127, 12, 124, 14, 129, 11, 128, 132, 16, 13, 17, 15, 131, 20, 20, 242, 123, 24, 32, 238, 3, 32, 357, 5, 238, 3, 5, 595, 5, 238, 3, 5, 833, 5, 238, 3, 5, 1071, 5, 238, 3, 5, 1309, 5, 238, 3, 5, 1547, 5, 238, 3, 5, 1785, 5, 238, 3, 5, 2023, 5, 238, 3, 5, 2261
OFFSET
1,1
COMMENTS
Sequences like this are more naturally considered with the first nonzero term in position 1. But this sequence would then match A000027 for its first 117 terms.
This sequence has exactly 3346939303954 terms (of positive index). a(3346939303954) = 0, so an attempt to calculate a(3346939303955) would refer to itself.
FORMULA
If the index is between 35 and 122 (inclusive), then a(5n) = 238n-1309, a(5n+1) = 5, a(5n+2) = 238, a(5n+3) = 3, a(5n+4) = 5.
If the index is between 128 and 4525 (inclusive), then a(5n) = 4641, a(5n+1) = 3, a(5n+2) = 5, a(5n+3) = 4641n-106981, a(5n+4) = 5.
If the index is between 4531 and 4093008 (inclusive), then a(5n) = 5, a(5n+1) = 4093124n-3700188737, a(5n+2) = 5, a(5n+3) = 4093124, a(5n+4) = 3.
If the index is between 4093008 and 3346939303796 (inclusive), then a(5n) = 5, a(5n+1) = 3346939303911, a(5n+2) = 3, a(5n+3) = 5, a(5n+4) = 3346939303911n-2739804514185637724.
MAPLE
A283883:=proc(n) option remember: if n <= 0 then max(0, n+117): else A283883(n-A283883(n-1)) + A283883(n-A283883(n-2)): fi: end:
CROSSREFS
KEYWORD
nonn,fini
AUTHOR
Nathan Fox, Mar 19 2017
STATUS
approved