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.

Previous Showing 11-15 of 15 results.

A001030 Fixed under 1 -> 21, 2 -> 211.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

If treated as the terms of a continued fraction, it converges to approximately
2.57737020881617828717350576260723346479894963737498275232531856357441\
7024804797827856956758619431996. - Peter Bertok (peter(AT)bertok.com), Nov 27 2001
There are a(n) 1's between successive 2's. - Eric Angelini, Aug 19 2008
Same sequence where 1's and 2's are exchanged: A001468. - Eric Angelini, Aug 19 2008

References

  • Midhat J. Gazale, Number: From Ahmes to Cantor, Section on 'Cleavages' in Chapter 6, Princeton University Press, Princeton, NJ 2000, pp. 203-211.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Length of the sequence after 'n' substitution steps is given by the terms of A000129.
Equals A004641(n) + 1.
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

Programs

  • Haskell
    Following Spage's PARI program.
    a001030 n = a001030_list !! (n-1)
    a001030_list = [2, 1, 1, 2] ++ f [2] [2, 1, 1, 2] where
       f us vs = ws ++ f vs (vs ++ ws) where
                 ws = 1 : us ++ 1 : vs
    -- Reinhard Zumkeller, Aug 04 2014
    
  • Mathematica
    ('n' is the number of substitution steps to perform.) Nest[Flatten[ # /. {1 -> {2, 1}, 2 -> {2, 1, 1}}] &, {1}, n]
    SubstitutionSystem[{1->{2,1},2->{2,1,1}},{2},{6}][[1]] (* Harvey P. Dale, Feb 15 2022 *)
  • PARI
    /* Fast string concatenation method giving e.g. 5740 terms in 8 iterations */
    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
    
  • Python
    from math import isqrt
    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

Formula

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]
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

Extensions

More terms from Peter Bertok (peter(AT)bertok.com), Nov 27 2001

A004641 Fixed under 0 -> 10, 1 -> 100.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Partial sums: A088462. - Reinhard Zumkeller, Dec 05 2009
Write w(n) = a(n) for n >= 1. Each w(n) is generated by w(i) for exactly one i <= n; let g(n) = i. Each w(i) generates a single 1, in a word (10 or 100) that starts with 1. Therefore, g(n) is the number of 1s among w(1), ..., w(n), so that g = A088462. That is, this sequence is generated by its partial sums. - Clark Kimberling, May 25 2011

Crossrefs

Equals A001030 - 1. Essentially the same as A006337 - 1 and A159684.
Characteristic function of A086377.
Cf. A081477.
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

Programs

  • Magma
    [Floor(n*(Sqrt(2) - 1) + Sqrt(1/2)) - Floor((n - 1)*(Sqrt(2) - 1) + Sqrt(1/2)): n in [0..100]]; // Vincenzo Librandi, Mar 27 2015
    
  • Maple
    P(0):= (1,0): P(1):= (1,0,0):
    ((P~)@@6)([1]);
    # in Maple 12 or earlier, comment the above line and uncomment the following:
    # (curry(map,P)@@6)([1]); # Robert Israel, Mar 26 2015
  • Mathematica
    Nest[ Flatten[# /. {0 -> {1, 0}, 1 -> {1, 0, 0}}] &, {1}, 5] (* Robert G. Wilson v, May 25 2011 *)
    SubstitutionSystem[{0->{1,0},1->{1,0,0}},{1},5]//Flatten (* Harvey P. Dale, Nov 20 2021 *)
  • Python
    from math import isqrt
    def A004641(n): return [1, 0, 0, 1, 0, 1, 0, 1][n-1] if n < 9 else -1-isqrt(m:=(n-9)*(n-9)<<1)+isqrt(m+(n-9<<2)+2) # Chai Wah Wu, Aug 25 2022

Formula

a(n) = floor(n*(sqrt(2) - 1) + sqrt(1/2)) - floor((n - 1)*(sqrt(2) - 1) + sqrt(1/2)) (from the de Bruijn reference). - Peter J. Taylor, Mar 26 2015
From Jianing Song, Jan 02 2019: (Start)
a(n) = A001030(n) - 1.
a(n) = A006337(n-9) - 1 = A159684(n-10) for n >= 10. (End)

A088462 a(1)=1, a(n) = ceiling((n - a(a(n-1)))/2).

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 32, 32
Offset: 1

Views

Author

Benoit Cloitre, Nov 12 2003

Keywords

Comments

Partial sums of A004641. - Reinhard Zumkeller, Dec 05 2009
This sequence generates A004641; see comment at A004641. - Clark Kimberling, May 25 2011

Crossrefs

Cf. A005206.
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

Programs

  • Magma
    [Floor((Sqrt(2)-1)*n+1/Sqrt(2)): n in [1..100]]; // Vincenzo Librandi, Jun 26 2017
  • Mathematica
    Table[Floor[(Sqrt[2] - 1) n + 1 / Sqrt[2]], {n, 100}] (* Vincenzo Librandi, Jun 26 2017 *)
  • Python
    l=[0, 1, 1]
    for n in range(3, 101): l.append(n - l[n - 1] - l[l[n - 2]])
    print(l[1:]) # Indranil Ghosh, Jun 24 2017, after Altug Alkan
    

Formula

a(n) = floor((sqrt(2)-1)*n + 1/sqrt(2)).
a(1) = a(2) = 1; a(n) = n - a(n-1) - a(a(n-2)) for n > 2. - Altug Alkan, Jun 24 2017

A114986 Characteristic function of (A000201 prefixed with 0).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 28 2006

Keywords

Crossrefs

Essentially the same as A005614. Cf. A096270, A189479.
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

A124842 Triangle, row sums = A005614, the rabbit sequence.

Original entry on oeis.org

1, 1, -1, 1, -2, 2, 1, -3, 6, -3, 1, -4, 12, -12, 3, 1, -5, 20, -30, 15, 0, 1, -6, 30, -60, 45, 0, -10, 1, -7, 42, -105, 105, 0, -70, 35, 1, -8, 56, -168, 210, 0, -280, 280, -90
Offset: 1

Views

Author

Gary W. Adamson, Nov 10 2006

Keywords

Examples

			First few rows of the triangle are:
1;
1, -1;
1, -2, 2;
1, -3, 6, -3;
1, -4, 12, -12, 3;
1, -5, 20, -30, 15, 0;
1, -6, 30, -60, 45, 0, -10;
...
4th term of the rabbit sequence (1, 0, 1, 1, 0...) = 1 = sum of row 4 terms: (1, - 3 + 6 - 3).
		

Crossrefs

Cf. A124841.

Formula

Binomial transform of the infinite matrix with the diagonalized sequence A124841.
Previous Showing 11-15 of 15 results.