cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A284054 Relative of Hofstadter Q-sequence.

This page as a plain text file.
%I A284054 #10 Jul 28 2021 04:33:23
%S A284054 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,
%T A284054 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,
%U A284054 48,40,24,78,7,16,24,16,72,32,24,104,7,24,24,16,96,40,24,130,7,24,32
%N A284054 Relative of Hofstadter Q-sequence.
%C A284054 This sequence is defined by a(n) = 0 for n <= 0; a(1) = 7, a(2) = 26, a(3) = 8, a(4) = 8, a(5) = 8, a(6) = 8, a(7) = 8, a(8) = 26, a(9) = 7, a(10) = 8, a(11) = 16, a(12) = 16, a(13) = 16, a(14) = 16, a(15) = 16, a(16) = 26; thereafter a(n) = a(n-a(n-1)) + a(n-a(n-2)).
%C A284054 Similar to Hofstadter's Q-sequence A005185 but with different starting values.
%C A284054 Much like the Hofstadter Q-sequence A005185, it is not known if this sequence is defined for all positive n.
%C A284054 This sequence has a similar structure to A272160. That sequence consists of five interleaved sequences: four chaotic sequences and a sequence of all 4's. This sequence appears to consist eventually of eight interleaved sequences: four chaotic sequences, a sequence of all 7's, a sequence of mostly 32's and an few 40's, a sequence of all 24's, and a rapidly growing sequence with successive terms satisfying either the recurrence A(k) = A(k-3) + A(k-4) or the recurrence A(k) = A(k-3) + A(k-5).
%C A284054 If the 26's in the initial condition are each replaced by larger numbers, the general structure of this sequence does not change.
%H A284054 Nathan Fox, <a href="/A284054/b284054.txt">Table of n, a(n) for n = 1..10000</a>
%p A284054 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:
%o A284054 (Python)
%o A284054 from functools import lru_cache
%o A284054 @lru_cache(maxsize=None)
%o A284054 def a(n):
%o A284054     if n <= 0: return 0
%o A284054     if n < 17:
%o A284054         return [7, 26, 8, 8, 8, 8, 8, 26, 7, 8, 16, 16, 16, 16, 16, 26][n-1]
%o A284054     return a(n - a(n-1)) + a(n - a(n-2))
%o A284054 print([a(n) for n in range(1, 76)]) # _Michael S. Branicky_, Jul 26 2021
%Y A284054 Cf. A005185, A272610, A283903, A284053.
%K A284054 nonn
%O A284054 1,1
%A A284054 _Nathan Fox_, Mar 19 2017