A004001 Hofstadter-Conway $10000 sequence: a(n) = a(a(n-1)) + a(n-a(n-1)) with a(1) = a(2) = 1.
1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 26, 27, 27, 27, 28, 29, 29, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42
Offset: 1
Examples
If n=4, 2^4=16, a(16-i) = 2^(4-1) = 8 for 0 <= i <= 4-1 = 3, hence a(16)=a(15)=a(14)=a(13)=8.
References
- J. Arkin, D. C. Arney, L. S. Dewald and W. E. Ebel, Jr., Families of recursive sequences, J. Rec. Math., 22 (No. 22, 1990), 85-94.
- B. W. Conolly, Meta-Fibonacci sequences, in S. Vajda, editor, "Fibonacci and Lucas Numbers and the Golden Section", Halstead Press, NY, 1989, pp. 127-138.
- R. K. Guy, Unsolved Problems Number Theory, Sect. E31.
- D. R. Hofstadter, personal communication.
- C. A. Pickover, Wonders of Numbers, "Cards, Frogs and Fractal sequences", Chapter 96, pp. 217-221, Oxford Univ. Press, NY, 2000.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
- S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Altug Alkan, On a Generalization of Hofstadter's Q-Sequence: A Family of Chaotic Generational Structures, Complexity (2018) Article ID 8517125.
- Altug Alkan and O. Ozgur Aybar, On Families of Solutions for Meta-Fibonacci Recursions Related to Hofstadter-Conway $10000 Sequence, Slides of talk at presented in 5th International Interdisciplinary Chaos Symposium on Chaos and Complex Systems, May 9-12, 2019.
- Altug Alkan, Nathan Fox, and Orhan Ozgur Aybar, On Hofstadter Heart Sequences, Complexity, Volume 2017, Article ID 2614163, 8 pages.
- B. Balamohan, A. Kuznetsov and S. Tanny, On the behavior of a variant of Hofstadter's Q-sequence, J. Integer Sequences, Vol. 10 (2007), #07.7.1.
- F. Michel Dekking, Morphisms, Symbolic Sequences, and Their Standard Forms, Journal of Integer Sequences, Vol. 19 (2016), Article 16.1.1.
- Nathaniel D. Emerson, A Family of Meta-Fibonacci Sequences Defined by Variable-Order Recursions, Journal of Integer Sequences, Vol. 9 (2006), Article 06.1.8.
- Christopher S. Flippen, Minimal Sets, Union-Closed Families, and Frankl's Conjecture, Master's thesis, Virginia Commonwealth Univ., 2023.
- Nathan Fox, Linear-Recurrent Solutions to Meta-Fibonacci Recurrences, Part 1 (video), Rutgers Experimental Math Seminar, Oct 01 2015. Part 2 is vimeo.com/141111991.
- Nathan Fox, A Slow Relative of Hofstadter's Q-Sequence, arXiv:1611.08244 [math.NT], 2016.
- S. W. Golomb, Discrete chaos: sequences satisfying "strange" recursions, unpublished manuscript, circa 1990 [cached copy, with permission (annotated)]
- J. Grytczuk, Another variation on Conway's recursive sequence, Discr. Math. 282 (2004), 149-161.
- R. K. Guy, Letter to N. J. A. Sloane, Sep 25 1986.
- R. K. Guy, Letter to N. J. A. Sloane with attachment, 1988
- R. K. Guy and N. J. A. Sloane, Correspondence, 1988.
- Nick Hobson, Python program for this sequence
- D. R. Hofstadter, Plot of 100000 terms of a(n)-n/2
- D. R. Hofstadter, Analogies and Sequences: Intertwined Patterns of Integers and Patterns of Thought Processes, Lecture in DIMACS Conference on Challenges of Identifying Integer Sequences, Rutgers University, Oct 10 2014; Part 1, Part 2.
- A. Isgur, R. Lech, S. Moore, S. Tanny, Y. Verberne, and Y. Zhang, Constructing New Families of Nested Recursions with Slow Solutions, SIAM J. Discrete Math., 30(2), 2016, 1128-1147. (20 pages); DOI:10.1137/15M1040505.
- D. Kleitman, Solution to Problem E3274, Amer. Math. Monthly, 98 (1991), 958-959.
- T. Kubo and R. Vakil, On Conway's recursive sequence, Discr. Math. 152 (1996), 225-252.
- C. L. Mallows, Conway's challenge sequence, Amer. Math. Monthly, 98 (1991), 5-20.
- D. Newman, Problem E3274, Amer. Math. Monthly, 95 (1988), 555.
- John A. Pelesko, Generalizing the Conway-Hofstadter $10,000 Sequence, Journal of Integer Sequences, Vol. 7 (2004), Article 04.3.5.
- K. Pinn, A chaotic cousin of Conway's recursive sequence, Experimental Mathematics, 9:1 (2000), 55-65.
- N. J. A. Sloane, Scan of notebook pages with notes on John Conway's Colloquium talk on Jul 15 1988 [See Comments above]
- N. J. A. Sloane, My favorite integer sequences, in Sequences and their Applications (Proceedings of SETA '98).
- I. Vardi, Email to N. J. A. Sloane, Jun. 1991
- Eric Weisstein's World of Mathematics, Hofstadter-Conway 10000-Dollar Sequence.
- Eric Weisstein's World of Mathematics, Newman-Conway Sequence
- Wikipedia, Hofstadter sequence
- Index entries for sequences related to binary expansion of n
- Index entries for Hofstadter-type sequences
Crossrefs
Programs
-
Haskell
a004001 n = a004001_list !! (n-1) a004001_list = 1 : 1 : h 3 1 {- memoization -} where h n x = x' : h (n + 1) x' where x' = a004001 x + a004001 (n - x) -- Reinhard Zumkeller, Jun 03 2011
-
Magma
[n le 2 select 1 else Self(Self(n-1))+ Self(n-Self(n-1)):n in [1..75]]; // Marius A. Burtea, Aug 16 2019
-
Maple
A004001 := proc(n) option remember; if n<=2 then 1 else procname(procname(n-1)) +procname(n-procname(n-1)); fi; end;
-
Mathematica
a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Table[ a[n], {n, 1, 75}] (* Robert G. Wilson v *)
-
PARI
a=vector(100);a[1]=a[2]=1;for(n=3,#a,a[n]=a[a[n-1]]+a[n-a[n-1]]);a \\ Charles R Greathouse IV, Jun 10 2011
-
PARI
first(n)=my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); v \\ Charles R Greathouse IV, Feb 26 2017
-
Python
def a004001(n): A = {1: 1, 2: 1} c = 1 #counter while n not in A.keys(): if c not in A.keys(): A[c] = A[A[c-1]] + A[c-A[c-1]] c += 1 return A[n] # Edward Minnix III, Nov 02 2015
-
SageMath
@CachedFunction def a(n): # a = A004001 if n<3: return 1 else: return a(a(n-1)) + a(n-a(n-1)) [a(n) for n in range(1,101)] # G. C. Greubel, Apr 25 2024
-
Scheme
;; An implementation of memoization-macro definec can be found for example from: http://oeis.org/wiki/Memoization (definec (A004001 n) (if (<= n 2) 1 (+ (A004001 (A004001 (- n 1))) (A004001 (- n (A004001 (- n 1))))))) ;; Antti Karttunen, Oct 22 2014
Formula
Limit_{n->infinity} a(n)/n = 1/2 and as special cases, if n > 0, a(2^n-i) = 2^(n-1) for 0 <= i < = n-1; a(2^n+1) = 2^(n-1) + 1. - Benoit Cloitre, Aug 04 2002 [Corrected by Altug Alkan, Apr 03 2017]
Comments