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.

Showing 1-8 of 8 results.

A006337 An "eta-sequence": a(n) = floor( (n+1)*sqrt(2) ) - floor( n*sqrt(2) ).

Original entry on oeis.org

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, 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, 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, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1
Offset: 1

Views

Author

D. R. Hofstadter, Jul 15 1977

Keywords

Comments

Defined by: (i) a(1) = 1; (ii) sequence consists of single 2's separated by strings of 1's; (iii) the sequence of lengths of runs of 1's in the sequence is equal to the sequence.
Equals its own "derivative", which is formed by counting the strings of 1's that lie between 2's.
First differences of A001951 (with a different offset). - Philippe Deléham, May 29 2006
Or number of perfect squares in interval (2*n^2, 2*(n+1)^2). In view of the uniform distribution mod 1 of sequence {sqrt(2)*n}, the density of 1's is 2-sqrt(2). - Vladimir Shevelev, Aug 05 2011
a(n) = number of repeating n's in A049472. - Reinhard Zumkeller, Jul 03 2015
Fixed point of the morphism 1 -> 12; 2 -> 121. - Jeffrey Shallit, Jan 19 2017
Also, let S be the increasing sequence of elements of the union N U N*sqrt(2), where N = {1, 2, 3, ...}. Then a(n) = { 1 if S(n) is integer, 2 if S(n) is irrational }. See A245222 for the analog with sqrt(3). - M. F. Hasler, Feb 06 2025

References

  • Douglas Hofstadter, "Fluid Concepts and Creative Analogies", Chapter 1: "To seek whence cometh a sequence".
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006338. Exchanging 1's and 2's gives A080763. Essentially same as A004641 + 1.
Cf. A049472.
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A003151 as the parent: A003151, A001951, A001952, A003152, A006337, A080763, A082844 (conjectured), A097509, A159684, A188037, A245219 (conjectured), A276862. - N. J. A. Sloane, Mar 09 2021
Cf. A245222 (an analog with sqrt(3) instead of sqrt(2)).

Programs

  • Haskell
    a006337 n = a006337_list !! (n-1)
    a006337_list = f [1] where
       f xs = ys ++ f ys where
              ys = concatMap (\z -> if z == 1 then [1,2] else [1,1,2]) xs
    -- Reinhard Zumkeller, May 06 2012
    
  • Maple
    Digits := 100; sq2 := sqrt(2.); A006337 := n->floor((n+1)*sq2)-floor(n*sq2);
  • Mathematica
    Flatten[ Table[ Nest[ Flatten[ # /. {1 -> {1, 2}, 2 -> {1, 1, 2}}] &, {1}, n], {n, 5}]] (* Robert G. Wilson v, May 06 2005 *)
    Differences[ Table[ Floor[ n*Sqrt[2]], {n, 1, 106}]] (* Jean-François Alcover, Apr 06 2012 *)
  • PARI
    a(n)=sqrt(2)*(n+1)\1-sqrt(2)*n\1 \\ Charles R Greathouse IV, Apr 06 2012
    
  • PARI
    a(n)=sqrtint(2*n^2+4*n+2)-sqrtint(2*n^2) \\ Charles R Greathouse IV, Apr 06 2012
    
  • Python
    from math import isqrt
    def A006337(n): return -isqrt(m:=n*n<<1)+isqrt(m+(n<<2)+2) # Chai Wah Wu, Aug 03 2022

Formula

Let S(0) = 1; obtain S(k) from S(k-1) by applying 1 -> 12, 2 -> 112; sequence is S(0), S(1), S(2), ... - Matthew Vandermast, Mar 25 2003
a(A003152(n)) = 1 and a(A003151(n)) = 2. - Philippe Deléham, May 29 2006
a(n) = A159684(n-1) + 1. - Filip Zaludek, Oct 28 2016

A245219 Continued fraction expansion of the constant c in A245218; c = sup{f(n,1)}, where f(1,x) = x + 1 and thereafter f(n,x) = x + 1 if n is in A001951, else f(n,x) = 1/x.

Original entry on oeis.org

3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2
Offset: 0

Views

Author

Clark Kimberling, Jul 13 2014

Keywords

Comments

See Comments at A245215.
Likely a duplicate of A097509. - R. J. Mathar, Jul 21 2014
Theorem: Referring to Problem B6 in the 81st William Lowell Putnam Mathematical Competition (see link), in the notation of the first solution, the sequence {c_i} equals A245219. This proves the conjecture in the previous comment. - Manjul Bhargava, Kiran Kedlaya, and Lenny Ng, Sep 09 2021.

Examples

			c = 3.43648484... ; the first 12 numbers f(n,1) comprise S(12) = {1, 2, 3, 1/3, 4/3, 7/3, 3/7, 10/7, 17/7, 24/7, 7/24, 31/24}; max(S(12)) = 24/7, with continued fraction [3,2,3].
		

Crossrefs

Cf. A226080 (infinite Fibonacci tree), A245217, A245218 (decimal expansion), A245222, A245225.
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A003151 as the parent: A003151, A001951, A001952, A003152, A006337, A080763, A082844 (conjectured), A097509, A159684, A188037, A245219 (conjectured), A276862. - N. J. A. Sloane, Mar 09 2021

Programs

  • Mathematica
    tmpRec = $RecursionLimit; $RecursionLimit = Infinity; u[x_] := u[x] = x + 1; d[x_] := d[x] = 1/x; r = Sqrt[2]; w = Table[Floor[k*r], {k, 2000}]; s[1] = 1; s[n_] := s[n] = If[MemberQ[w, n - 1], u[s[n - 1]], d[s[n - 1]]]; max = Max[N[Table[s[n], {n, 1, 3000}], 200]] (* A245217 *)
    ContinuedFraction[max, 120] (* A245219 *)

Extensions

Offset changed by Andrew Howroyd, Jul 07 2024

A245215 Decimal expansion of inf{f(n,1)}, where f(1,x) = x + 1 and thereafter f(n,x) = f(n-1,x) + 1 if n is in A000201, else f(n,x) = 1/f(n-1,x).

Original entry on oeis.org

3, 6, 6, 3, 0, 4, 6, 9, 4, 6, 5, 3, 2, 7, 2, 6, 5, 6, 6, 8, 2, 4, 9, 4, 1, 3, 1, 4, 2, 9, 0, 9, 6, 6, 9, 2, 9, 9, 8, 4, 2, 7, 8, 8, 9, 3, 9, 2, 5, 4, 3, 1, 6, 0, 4, 1, 0, 3, 1, 0, 3, 8, 0, 6, 3, 6, 0, 0, 5, 6, 4, 5, 2, 9, 0, 6, 1, 5, 4, 6, 1, 6, 9, 4, 9, 5
Offset: 1

Views

Author

Clark Kimberling, Jul 13 2014

Keywords

Comments

Equivalently, f(n,x) = 1/(f(n-1,x) if n is in A001950 (upper Wythoff sequence, given by w(n) = floor[tau*n], where tau = (1 + sqrt(5))/2, the golden ratio) and f(n,x) = f(n-1) + 1 otherwise. Let c = inf{f(n,1)}. The continued fraction of c is [0,2,1,2,1,2,2,1,2,2,1,2, ...], and the continued fraction of sup{f(n,x)}, alias -2 + 1/c, appears to be identical to the Hofstadter eta-sequence at A006340: (2, 1, 2, 1, 2, 2, 1, 2, 2, 1, 2,...). Other limiting constants are similarly obtained using other pairs of Beatty sequences:
...
Beatty sequence .... inf{f(n,1)} ... sup{f(n,1)}
A000201 (tau) ...... A245215 ....... A245216
A001951 (sqrt(2)) .. A245217 ....... A245218; cont. fr. A245219
A022838 (sqrt(3)) .. A245220 ....... A245221; cont. fr. A245222
A054385 (e/(e-1)) .. A245223 ....... A245224; cont. fr. A245225

Examples

			c = 0.366304694653272656682494131429096692998...  The first 12 numbers f(n,1) comprise S(12) = {1, 2, 1/2, 3/2, 5/2, 2/5, 7/5, 5/7, 12/7, 19/7, 7/19, 26/19}; min(S(12)) = 7/19 = 0.36842...
		

Crossrefs

Cf. A226080 (infinite Fibonacci tree), A006340, A245216, A245217, A245220, A245223, A246129.

Programs

  • Mathematica
    tmpRec = $RecursionLimit; $RecursionLimit = Infinity; u[x_] := u[x] = x + 1; d[x_] := d[x] = 1/x; r = GoldenRatio; w = Table[Floor[k*r], {k, 2000}]; s[1] = 1; s[n_] := s[n] = If[MemberQ[w, n - 1], u[s[n - 1]], d[s[n - 1]]]; $RecursionLimit = tmpRec;
    m = Min[N[Table[s[n], {n, 1, 4000}], 300]]
    t = RealDigits[m]  (* A245215 *)
    (* Peter J. C. Moses, Jul 04 2014 *)

Formula

a(n)*(2 + sup{f(n,1)}) = 1.
Equals 1/A245216 = A246129 - 2. - Hugo Pfoertner, Nov 10 2024

A245220 Decimal expansion of inf{f(n,1)}, where f(1,x) = x + 1 and thereafter f(n,x) = x + 1 if n is in A022838, else f(n,x) = 1/x.

Original entry on oeis.org

3, 6, 7, 5, 4, 3, 4, 9, 1, 1, 8, 4, 9, 5, 1, 2, 4, 8, 7, 2, 1, 2, 6, 0, 9, 7, 2, 5, 4, 1, 0, 9, 2, 5, 4, 0, 7, 0, 8, 3, 4, 4, 0, 8, 8, 6, 0, 5, 2, 0, 6, 3, 6, 5, 9, 3, 6, 0, 9, 1, 7, 8, 7, 0, 4, 6, 9, 2, 5, 9, 5, 1, 9, 7, 4, 4, 3, 5, 6, 0, 6, 2, 5, 8, 0, 2
Offset: 1

Views

Author

Clark Kimberling, Jul 14 2014

Keywords

Comments

See Comments at A245215.

Examples

			c = 0.367543491184951248721260972541092540...  The first 12 numbers f(n,1) comprise S(12) = {1, 2, 1/2, 3/2, 2/3, 5/3, 8/3, 3/8, 11/8, 8/11, 19/11, 11/19}; min(S(12)) = 3/8 = 0.375... and max(S(12)) = 8/3 = 2.666...
		

Crossrefs

Cf. A226080 (infinite Fibonacci tree), A245215, A245217, A245221, A245222.

Programs

  • Mathematica
    tmpRec = $RecursionLimit; $RecursionLimit = Infinity; u[x_] := u[x] = x + 1; d[x_] := d[x] = 1/x; r = Sqrt[3]; w = Table[Floor[k*r], {k, 2000}]; s[1] = 1; s[n_] := s[n] = If[MemberQ[w, n - 1], u[s[n - 1]], d[s[n - 1]]]; $RecursionLimit = tmpRec;
    m = Min[N[Table[s[n], {n, 1, 4000}], 300]]
    t = RealDigits[m]  (* A245220 *)
    (* Peter J. C. Moses, Jul 04 2014 *)

Formula

a(n)*sup{f(n,1)} = 1.

A188070 Positions of 1 in A188068; complement of A188069.

Original entry on oeis.org

2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 16, 17, 18, 20, 21, 22, 24, 25, 26, 28, 29, 31, 32, 33, 35, 36, 37, 39, 40, 41, 43, 44, 46, 47, 48, 50, 51, 52, 54, 55, 57, 58, 59, 61, 62, 63, 65, 66, 67, 69, 70, 72, 73, 74, 76, 77, 78, 80, 81, 82, 84, 85, 87, 88, 89, 91, 92, 93, 95, 96, 97, 99, 100, 102, 103, 104, 106, 107, 108, 110, 111, 113, 114, 115, 117, 118, 119, 121, 122, 123, 125
Offset: 1

Views

Author

Clark Kimberling, Mar 20 2011

Keywords

Comments

Also positions of 3 in A007538. - Reinhard Zumkeller, Feb 14 2012
From Peter G. Anderson, Aug 24 2012: (Start)
a(n) = ceiling(n*x) where x = (1+sqrt(3))/2;
continued fraction of x is [1,2,1,2,1,2,...]. (End)
Conjectured partial sums of A245222. - Sean A. Irvine, Jun 26 2022

Crossrefs

A215781 is ceiling(n*(sqrt(3)-1)).

Programs

  • Haskell
    a188070 n = a188070_list !! (n-1)
    a188070_list = filter ((== 3) . a007538) [1..]
    -- Reinhard Zumkeller, Feb 14 2012
    
  • J
    >. (2 %~ 1 + %:3) * i.100  NB. Peter G. Anderson, Aug 24 2012
  • Mathematica
    (* See A188068. *)

A144612 Sturmian word of slope (3-sqrt(3))/2.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jan 13 2009

Keywords

Comments

Since 1 - (3-sqrt(3))/2 has a periodic continued fraction expansion with period 21, (a(n)) is the unique fixed point of the morphism 0 -> 10110, 1 -> 101. - Michel Dekking, Feb 05 2017
Also, sequence of (1 if x is integer, else 0) as x runs over the elements of N U N*sqrt(3) in increasing order, N = {1, 2, 3, ...}. - M. F. Hasler, Feb 06 2025

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 286.

Crossrefs

Cf. A245222 (= 2 - a(n)),

Programs

  • Magma
    [Floor((n+1)*(3-Sqrt(3))/2)-Floor(n*(3-Sqrt(3))/2): n in [1..100]]; // Vincenzo Librandi, Feb 05 2017
  • Mathematica
    Table[(Floor[(n + 1) (3 - Sqrt[3])/2] - Floor[n (3 - Sqrt[3])/2]), {n, 100}] (* Vincenzo Librandi, Feb 05 2017 *)

Formula

a(n) = floor((n+1)r) - floor(nr), where r = (3-sqrt(3))/2.
a(n) = 2 - A245222(n). - M. F. Hasler, Feb 06 2025

Extensions

Corrected and extended by Michel Dekking, Feb 05 2017

A245221 Decimal expansion of sup{f(n,1)}, where f(1,x) = x + 1 and thereafter f(n,x) = x + 1 if n is in A022838, else f(n,x) = 1/x.

Original entry on oeis.org

2, 7, 2, 0, 7, 6, 6, 4, 5, 0, 7, 2, 9, 4, 7, 5, 2, 9, 7, 5, 4, 6, 9, 5, 1, 7, 3, 4, 8, 1, 7, 1, 5, 1, 3, 2, 4, 2, 5, 4, 7, 4, 9, 7, 9, 6, 1, 7, 1, 4, 6, 4, 1, 6, 7, 9, 0, 0, 0, 8, 2, 8, 3, 6, 6, 8, 7, 6, 6, 2, 4, 2, 1, 2, 1, 6, 7, 7, 7, 9, 0, 9, 7, 7, 8, 6
Offset: 1

Views

Author

Clark Kimberling, Jul 14 2014

Keywords

Comments

See Comments at A245215.

Examples

			c = 0.367543491184951248721260972541092540...  The first 12 numbers f(n,1) comprise S(12) = {1, 2, 1/2, 3/2, 2/3, 5/3, 8/3, 3/8, 11/8, 8/11, 19/11, 11/19}; min(S(12)) = 3/8 = 0.375... and max(S(12)) = 8/3 = 2.666...
		

Crossrefs

Cf. A226080 (infinite Fibonacci tree), A245215, A245217, A245220, A245222.

Programs

  • Mathematica
    tmpRec = $RecursionLimit; $RecursionLimit = Infinity; u[x_] := u[x] = x + 1; d[x_] := d[x] = 1/x; r = Sqrt[3]; w = Table[Floor[k*r], {k, 2000}]; s[1] = 1; s[n_] := s[n] = If[MemberQ[w, n - 1], u[s[n - 1]], d[s[n - 1]]]; $RecursionLimit = tmpRec;
    m = Max[N[Table[s[n], {n, 1, 4000}], 300]]
    t = RealDigits[m]  (* A245221 *)
    (* Peter J. C. Moses, Jul 04 2014 *)

Formula

a(n)*inf{f(n,1)} = 1.

A245225 Continued fraction expansion of the constant c in A245224; c = sup{f(n,1)}, where f(1,x) = x + 1 and thereafter f(n,x) = x + 1 if n is in A054385, else f(n,x) = 1/x.

Original entry on oeis.org

2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2
Offset: 0

Views

Author

Clark Kimberling, Jul 14 2014

Keywords

Comments

See Comments at A245215.

Examples

			c = 2.70777871600507812434020666596313162... ; The first 16 numbers f(n,1) comprise S(16) = {1, 2, 1/2, 3/2, 5/2, 2/5, 7/5, 12/5, 5/12, 17/12, 12/17, 29/17}; max(S(16)) = 46/17, with continued fraction [2, 1, 2, 2, 2].
		

Crossrefs

Cf. A226080 (infinite Fibonacci tree), A245217, A245219, A245222, A245224 (decimal expansion).

Programs

  • Mathematica
    tmpRec = $RecursionLimit; $RecursionLimit = Infinity; u[x_] := u[x] = x + 1; d[x_] := d[x] = 1/x; r = E/(E-1); w = Table[Floor[k*r], {k, 2000}]; s[1] = 1; s[n_] := s[n] = If[MemberQ[w, n - 1], u[s[n - 1]], d[s[n - 1]]]; max = Max[N[Table[s[n], {n, 1, 3000}], 200]] (* A245224 *)
    ContinuedFraction[max, 120] (* A245225 *)

Extensions

Offset changed by Andrew Howroyd, Jul 07 2024
Showing 1-8 of 8 results.