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 A001030 M0068 N0021 #93 Dec 24 2023 01:19:37 %S A001030 2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1, %T A001030 2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1, %U A001030 2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2 %N A001030 Fixed under 1 -> 21, 2 -> 211. %C A001030 If treated as the terms of a continued fraction, it converges to approximately %C A001030 2.57737020881617828717350576260723346479894963737498275232531856357441\ %C A001030 7024804797827856956758619431996. - Peter Bertok (peter(AT)bertok.com), Nov 27 2001 %C A001030 There are a(n) 1's between successive 2's. - _Eric Angelini_, Aug 19 2008 %C A001030 Same sequence where 1's and 2's are exchanged: A001468. - _Eric Angelini_, Aug 19 2008 %D A001030 Midhat J. Gazale, Number: From Ahmes to Cantor, Section on 'Cleavages' in Chapter 6, Princeton University Press, Princeton, NJ 2000, pp. 203-211. %D A001030 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A001030 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A001030 T. D. Noe, <a href="/A001030/b001030.txt">Table of n, a(n) for n=1..8119</a> %H A001030 N. G. de Bruijn, <a href="http://alexandria.tue.nl/repository/freearticles/597565.pdf">Sequences of zeros and ones generated by special production rules</a>, Indag. Math., 43 (1981), 27-37. %H A001030 D. R. Hofstadter, <a href="/A006336/a006336_1.pdf">Eta-Lore</a> [Cached copy, with permission] %H A001030 D. R. Hofstadter, <a href="/A006336/a006336_2.pdf">Pi-Mu Sequences</a> [Cached copy, with permission] %H A001030 D. R. Hofstadter and N. J. A. Sloane, <a href="/A006336/a006336.pdf">Correspondence, 1977 and 1991</a> %H A001030 A. Nagel, <a href="http://www.jstor.org/stable/2687909">A self-defining infinite sequence, with an application to Markoff chains and probability</a>, Math. Mag., 36 (1963), 179-183. %H A001030 N. J. A. Sloane, <a href="/A001149/a001149.pdf">Handwritten notes on Self-Generating Sequences, 1970</a> (note that A1148 has now become A005282). %H A001030 N. J. A. Sloane, <a href="/A115004/a115004.txt">Families of Essentially Identical Sequences</a>, Mar 24 2021 (Includes this sequence). %F A001030 a(n) = -1 + floor(n*(1+sqrt(2))+1/sqrt(2))-floor((n-1)*(1+sqrt(2))+1/sqrt(2)). - _Benoit Cloitre_, Jun 26 2004. [I don't know if this is a theorem or a conjecture. - _N. J. A. Sloane_, May 14 2008] %F A001030 This is a theorem, following from Hofstadter's Generalized Fundamental Theorem of eta-sequences on page 10 of Eta-Lore. See also de Bruijn's paper from 1981 (hint from Benoit Cloitre). - _Michel Dekking_, Jan 22 2017 %t A001030 ('n' is the number of substitution steps to perform.) Nest[Flatten[ # /. {1 -> {2, 1}, 2 -> {2, 1, 1}}] &, {1}, n] %t A001030 SubstitutionSystem[{1->{2,1},2->{2,1,1}},{2},{6}][[1]] (* _Harvey P. Dale_, Feb 15 2022 *) %o A001030 A001030 := proc(n) begin [ 2 ]; while nops(%)<n do subs(%,[ 1=(2,1),2=(2,1,1) ]) end_while; %[ n ] end_proc: %o A001030 (PARI) /* Fast string concatenation method giving e.g. 5740 terms in 8 iterations */ %o A001030 a="2";b="2,1,1,2";print1(b);for(x=1,8,c=concat([",1,",a,",1,",b]);print1(c);a=b;b=concat(b,c)) \\ _K. Spage_, Oct 08 2009 %o A001030 (Haskell) Following Spage's PARI program. %o A001030 a001030 n = a001030_list !! (n-1) %o A001030 a001030_list = [2, 1, 1, 2] ++ f [2] [2, 1, 1, 2] where %o A001030 f us vs = ws ++ f vs (vs ++ ws) where %o A001030 ws = 1 : us ++ 1 : vs %o A001030 -- _Reinhard Zumkeller_, Aug 04 2014 %o A001030 (Python) %o A001030 from math import isqrt %o A001030 def A001030(n): return [2, 1, 1, 2, 1, 2, 1, 2][n-1] if n < 9 else -isqrt(m:=(n-9)*(n-9)<<1)+isqrt(m+(n-9<<2)+2) # _Chai Wah Wu_, Aug 25 2022 %Y A001030 Length of the sequence after 'n' substitution steps is given by the terms of A000129. %Y A001030 Equals A004641(n) + 1. %Y A001030 The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A000201 as the parent: A000201, A001030, A001468, A001950, A003622, A003842, A003849, A004641, A005614, A014675, A022342, A088462, A096270, A114986, A124841. - _N. J. A. Sloane_, Mar 11 2021 %K A001030 nonn,nice,easy %O A001030 1,1 %A A001030 _N. J. A. Sloane_ %E A001030 More terms from Peter Bertok (peter(AT)bertok.com), Nov 27 2001