A005376 a(n) = n - a(a(a(a(a(n-1))))).
0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 38, 39, 40, 40, 41, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 51, 52, 52, 53, 54, 54
Offset: 0
Keywords
References
- Karl Dilcher, On a class of iterative recurrence relations, in G. E. Bergum, A. N. Philippou, and A. F. Horadam, editors, Applications of Fibonacci Numbers, vol. 5, p. 143-158, Springer, 1993.
- Douglas R. Hofstadter, "Goedel, Escher, Bach", p. 137.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- G. C. Greubel, Table of n, a(n) for n = 0..10000
- Larry Ericksen and Peter G. Anderson, Patterns in differences between rows in k-Zeckendorf arrays, The Fibonacci Quarterly, Vol. 50, No. 1 (February 2012), pp. 11-18.
- Nick Hobson, Python program for this sequence
- Pierre Letouzey, Generalized Hofstadter functions G,H and beyond: numeration systems and discrepancy, arXiv:2502.12615 [cs.DM], 2025.
- Pierre Letouzey, Shuo Li and Wolfgang Steiner, Pointwise order of generalized Hofstadter functions G,H and beyond, arXiv:2410.00529 [cs.DM], 2024.
- Index entries for Hofstadter-type sequences
- Index entries for sequences from "Goedel, Escher, Bach"
Programs
-
Maple
H:=proc(n) option remember; if n=1 then 1 else n-H(H(H(H(H(n-1))))); fi; end proc;
-
Mathematica
a[n_]:= a[n]= If[n<1, 0, n -a[a[a[a[a[n-1]]]]]]; Table[a[n], {n, 0, 100}] (* G. C. Greubel, Nov 16 2022 *)
-
SageMath
@CachedFunction # a = A005376 def a(n): return 0 if (n==0) else n - a(a(a(a(a(n-1))))) [a(n) for n in range(101)] # G. C. Greubel, Nov 16 2022
Formula
a(n + a(a(a(a(n))))) = n (proved in Letouzey-Li-Steiner link). - Pierre Letouzey, Mar 06 2025
Extensions
More terms from James Sellers, Jul 12 2000
Comments