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.
%I A226222 #11 Feb 16 2025 08:33:19 %S A226222 1,1,1,2,2,3,3,3,4,5,5,5,6,6,7,7,8,9,9,9,10,10,11,11,11,12,13,13,13, %T A226222 14,15,16,16,16,17,18,18,18,18,19,20,21,21,21,21,22,22,23,23,24,25,25, %U A226222 25,26,26,27,27,28,29,30,30,30,31,32,32,32,32,33,35,35 %N A226222 a(1) = a(2) = a(3) = 1, a(n) = a(n-2-a(n-2)) + a(n-1-a(n-3)) for n>3. %C A226222 First numbers not occurring: 62, 66, 75, 79, 114, 123, ... . %H A226222 Reinhard Zumkeller, <a href="/A226222/b226222.txt">Table of n, a(n) for n = 1..10000</a> %H A226222 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HofstadtersQ-Sequence.html">Hofstadter's Q-Sequence</a> %H A226222 Wikipedia, <a href="http://en.wikipedia.org/wiki/Hofstadter_sequence">Hofstadter sequence</a> %H A226222 <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a> %F A226222 a(n) = a(n-2 - a(n-2)) + a(n-1 - a(n-3)), with a(1) = a(2) = a(3) = 1. %t A226222 a[n_]:= a[n]= If[n<4, 1, a[n-2 -a[n-2]] + a[n-1 -a[n-3]]]; %t A226222 Table[a[n], {n, 80}] (* _G. C. Greubel_, Mar 28 2022 *) %o A226222 (Haskell) %o A226222 a226222 n = a226222_list !! (n-1) %o A226222 a226222_list = 1 : 1 : 1 : zipWith (+) %o A226222 (map a226222 $ zipWith (-) [3..] a226222_list) %o A226222 (map a226222 $ zipWith (-) [2..] $ tail a226222_list) %o A226222 -- _Reinhard Zumkeller_, May 31 2013 %o A226222 (Sage) %o A226222 @CachedFunction %o A226222 def a(n): # A226222 %o A226222 if (n<4): return 1 %o A226222 else: return a(n-2-a(n-2)) + a(n-1-a(n-3)) %o A226222 [a(n) for n in (1..80)] # _G. C. Greubel_, Mar 28 2022 %Y A226222 Cf. A005185, A046699, A063892, A070867. %K A226222 nonn,look %O A226222 1,4 %A A226222 _Reinhard Zumkeller_, May 31 2013