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-10 of 23 results. Next

A184119 Upper s(n)-Wythoff sequence, where s(n) = 2n - 1; complement of A136119.

Original entry on oeis.org

2, 6, 9, 12, 16, 19, 23, 26, 30, 33, 36, 40, 43, 47, 50, 53, 57, 60, 64, 67, 70, 74, 77, 81, 84, 88, 91, 94, 98, 101, 105, 108, 111, 115, 118, 122, 125, 129, 132, 135, 139, 142, 146, 149, 152, 156, 159, 163, 166, 170, 173, 176, 180, 183, 187, 190, 193, 197, 200, 204, 207, 210, 214, 217, 221, 224, 228, 231, 234, 238, 241, 245, 248, 251, 255, 258, 262, 265, 269, 272, 275, 279, 282, 286, 289, 292, 296, 299, 303, 306, 309, 313, 316, 320, 323, 327, 330, 333, 337, 340
Offset: 1

Views

Author

Clark Kimberling, Jan 09 2011

Keywords

Comments

See A184117 for the definition of lower and upper s(n)-Wythoff sequences.
(a(n)) is an inhomogeneous Beatty sequence, the complement of the inhomogeneous Beatty sequence (A136119(n)) = (floor(sqrt(2)*n + 1 - sqrt(2)/2)). See the paper by Fraenkel. - Michel Dekking, Jan 31 2017

Crossrefs

Programs

  • Magma
    [Floor((2+Sqrt(2))*n-Sqrt(2)/2): n in [1..80]]; // Vincenzo Librandi, Jan 31 2017
  • Mathematica
    k=2; r=1;
    mex:=First[Complement[Range[1, Max[#1]+1], #1]]&;
    s[n_]:=k*n-r; a[1]=1; b[n_]:=b[n]=s[n]+a[n];
    a[n_]:=a[n]=mex[Flatten[Table[{a[i], b[i]},{i, 1, n-1}]]];
    Table[s[n], {n, 30}]
    Table[a[n], {n, 100}]
    Table[b[n], {n, 100}]
    Table[(Floor[(2 + Sqrt[2]) n - Sqrt[2]/2]), {n, 100}] (* Vincenzo Librandi, Jan 31 2017 *)

Formula

a(n) = floor((2+sqrt(2))*n - sqrt(2)/2). - Michel Dekking, Jan 31 2017

A270226 a(n) is the number of terms in the n-th block of consecutive integers of A136119.

Original entry on oeis.org

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

Views

Author

Benedict W. J. Irwin, Mar 13 2016

Keywords

Comments

Conjecture: Partial average of the sequence converges to 1+sqrt(2).
Proof of the conjecture: since A136119(n+1) - A136119(n) = A001030(n), the sequence (a(n+1)) is the fixed point of the substitution sigma: 2->32, 3->322. Here one uses that since sigma(a)=a, the length of the n-th block is coded by the n-th letter. Since the frequencies of 2 and 3 in this fixed point are respectively sqrt(2)/(1+sqrt(2)) and 1/(1+sqrt(2)), the conjecture follows. (Alternatively: (a(n+1)-2) is a Sturmian sequence with density sqrt(2)-1). - Michel Dekking, Jan 22 2017

Examples

			From A136119 consecutive blocks are
1          a(1)=1,
3, 4, 5    a(2)=3,
7, 8       a(3)=2,
10, 11     a(4)=2,
13, 14, 15 a(5)=3.
		

Crossrefs

Cf. A136119.

Programs

  • C
    #include 
    #include 
    int main(){
    int i,a,b; int j=0;
    for(i=2; i<200; i++){
            a=ceil((i-0.5)*sqrt(2));
            b=ceil((i-1.5)*sqrt(2));
            if(a-b==1)j++;
            else{j++; printf("%d,",j); j=0;}
    }
    return 0;
    }

Formula

a(1)=1, a(n+1) = floor(n*sqrt(2)+1/sqrt(2)) - floor((n-1)*sqrt(2)+1/sqrt(2)) + 1. - Michel Dekking, Jan 22 2017

A184117 Lower s-Wythoff sequence, where s(n) = 2n + 1.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 15, 16, 18, 19, 20, 22, 23, 25, 26, 27, 29, 30, 32, 33, 35, 36, 37, 39, 40, 42, 43, 44, 46, 47, 49, 50, 52, 53, 54, 56, 57, 59, 60, 61, 63, 64, 66, 67, 69, 70, 71, 73, 74, 76, 77, 78, 80, 81, 83, 84, 85, 87, 88, 90, 91, 93, 94, 95, 97, 98, 100, 101, 102, 104, 105, 107, 108, 110, 111, 112, 114, 115, 117, 118, 119, 121, 122, 124, 125, 126, 128, 129, 131, 132, 134, 135, 136, 138, 139, 141
Offset: 1

Views

Author

Clark Kimberling, Jan 09 2011

Keywords

Comments

Suppose that s(n) is a nondecreasing sequence of positive integers. The lower and upper s(n)-Wythoff sequences, a and b, are introduced here. Define
a(1) = 1; b(1) = s(1) + a(1); and for n>=2,
a(n) = least positive integer not in {a(1),...,a(n-1),b(1),...,b(n-1)},
b(n) = s(n) + a(n).
Clearly, a and b are complementary. If s(n)=n, then
a=A000201, the lower Wythoff sequence, and
b=A001950, the upper Wythoff sequence.
A184117 is chosen to represent the class of s-Wythoff sequences for which s is an arithmetic sequence given by s(n) = kn - r. Such sequences (lower and upper) are indexed in the OEIS as shown here:
n+1....A026273...A026274
n......A000201...A001950 (the classical Wythoff sequences)
2n+1...A184117...A184118
2n.....A001951...A001952
2n-1...A136119...A184119
3n+1...A184478...A184479
3n.....A184480...A001956
3n-1...A184482...A184483
3n-2...A184484...A184485
4n+1...A184486...A184487
4n.....A001961...A001962
4n-1...A184514...A184515
The pattern continues for A184516 to A184531.
s-Wythoff sequences for choices of s other than arithmetic sequences include these:
A184419 and A184420 (s = lower Wythoff sequence)
A184421 and A184422 (s = upper Wythoff sequence)
A184425 and A184426 (s = triangular numbers)
A184427 and A184428 (s = squares)
A036554 and A003159 (invariant and limiting sequences).

Examples

			s=(3,5,7,9,11,13,...);
a=(1,2,3,5,6,8,...);
b=(4,7,10,14,17,21,...).
		

Crossrefs

Programs

  • Mathematica
    k=2; r=-1;
    mex:=First[Complement[Range[1,Max[#1]+1],#1]]&;
    s[n_]:=k*n-r; a[1]=1; b[n_]:=b[n]=s[n]+a[n];
    a[n_]:=a[n]=mex[Flatten[Table[{a[i],b[i]},{i,1,n-1}]]];
    Table[s[n],{n,30}]  (* s = A005408 except for initial 1 *)
    Table[a[n],{n,100}] (* a = A184117 *)
    Table[b[n],{n,100}] (* b = A184118 *)
  • PARI
    A184117_upto(N,s(n)=2*n+1,a=[1],U=a)={while(a[#a]1&&U[2]==U[1]+1,U=U[^1]);a=concat(a,U[1]+1));a} \\ M. F. Hasler, Jan 07 2019

Formula

a(n) = A184118(n) - s(n). - M. F. Hasler, Jan 07 2019

Extensions

Removed an incorrect g.f., Alois P. Heinz, Dec 14 2012

A099267 Numbers generated by the golden sieve.

Original entry on oeis.org

2, 3, 5, 6, 8, 10, 11, 13, 14, 16, 18, 19, 21, 23, 24, 26, 27, 29, 31, 32, 34, 35, 37, 39, 40, 42, 44, 45, 47, 48, 50, 52, 53, 55, 57, 58, 60, 61, 63, 65, 66, 68, 69, 71, 73, 74, 76, 78, 79, 81, 82, 84, 86, 87, 89, 90, 92, 94, 95, 97, 99, 100, 102, 103, 105, 107, 108, 110
Offset: 1

Views

Author

Benoit Cloitre, Nov 15 2002

Keywords

Comments

Let f(n) denote the n-th term of the current working sequence. Start with the positive integers:
1,2,3,4,5,6,7,8,9,10,11,12,...
Delete the term in position f(1), which is f(f(1))=f(1)=1, leaving:
2,3,4,5,6,7,8,9,10,11,12,...
Delete the term in position f(2), which is f(f(2))=f(3)=4, leaving:
2,3,5,6,7,8,9,10,11,12,...
Delete the term in position f(3), which is f(f(3))=f(5)=7, leaving:
2,3,5,6,8,9,10,11,12,...
Delete the term in position f(4), which is f(f(4))=f(6)=9, leaving:
2,3,5,6,8,10,11,12,...
Iterating the "sieve" indefinitely produces the sequence:
2,3,5,6,8,10,11,13,14,16,18,19,21,23,24,26,27,29,31,32,34,35,37,39,...
Positions of 1 in A189479. - Clark Kimberling, Apr 22 2011

Crossrefs

Numbers n such that a(n+1)-a(n)=2 are given by A004956.
If prefixed by an initial 1, same as A026355.
Complement of A007066. - Gerald Hillier, Dec 19 2008
Cf. A193213 (primes).

Programs

  • Haskell
    a099267 n = a099267_list !! (n-1)
    a099267_list = f 1 [1..] 0 where
       f k xs y = ys' ++ f (k+1) (ys ++ xs') g where
         ys' = dropWhile (< y) ys
         (ys,_:xs') = span (< g) xs
         g = xs !! (h - 1)
         h = xs !! (k - 1)
    -- Reinhard Zumkeller, Sep 18 2011
  • Mathematica
    t = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0, 1}}] &, {0}, 6] (*A189479*)
    Flatten[Position[t, 0]] (*A007066*)
    Flatten[Position[t, 1]] (*A099267*)

Formula

a(n) = floor(n*phi + 2 - phi) where phi = (1 + sqrt(5))/2.
a(a(...a(1)...)) with n iterations equals F(n+1) = A000045(n+1).
For n>0 and k>0 we have a(a(n) + F(k) - (1 + (-1)^k)/2) = a(a(n)) + F(k+1) - 1 - (-1)^k. - Benoit Cloitre, Nov 22 2004
a(n) = a(a(n)) - n. - Marc Morgenegg, Sep 23 2019

A136120 Limiting sequence when we start with the positive integers (A000027) and at step n >= 1 delete the a(n) terms at positions n+a(n) to n-1+2*a(n).

Original entry on oeis.org

1, 3, 4, 5, 9, 10, 15, 16, 22, 23, 24, 25, 26, 36, 37, 48, 49, 50, 51, 52, 53, 69, 70, 87, 88, 89, 90, 91, 92, 93, 116, 117, 141, 142, 167, 168, 194, 195, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 269, 270, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317
Offset: 1

Views

Author

Ctibor O. Zizka, Mar 16 2008

Keywords

Examples

			First few steps are:
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,...
n = 1, a(1) = 1; delete terms at positions 2 to 2; this is 2;
1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,...
n = 2,a(2) = 3; delete terms at positions 5 to 7; these are 6,7,8;
1,3,4,5,9,10,11,12,13,14,15,16,17,18,19,20,21,22,...
n = 3, a(3) = 4; delete terms at positions 7 to 10; these are 11,12,13,14;
1,3,4,5,9,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
n = 4, a(4) = 5; delete terms at positions 9 to 13; these are 17,18,19,20,21;
1,3,4,5,9,10,15,16,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36...
n = 5 a(5) = 9; delete terms at positions 14 to 22; these are 27,28,29,30,31,32,33,34,35;
1,3,4,5,9,10,15,16,22,23,24,25,26,36,...
		

Crossrefs

Programs

  • Mathematica
    f[seq_] := Module[{s = seq, n1, n2}, n++; n1 = s[[n]] + n; If[n1 <= len, n2 = Min[n - 1 + 2*s[[n]], len]; len -= n2 - n1 + 1; Drop[s, {n1, n2}], s]]; n = 0; len = 1000; FixedPoint[f, Range[len]] (* Jean-François Alcover, Sep 29 2011 *)

Extensions

Edited and extended by Klaus Brockhaus, Apr 20 2008

A001953 a(n) = floor((n + 1/2) * sqrt(2)).

Original entry on oeis.org

0, 2, 3, 4, 6, 7, 9, 10, 12, 13, 14, 16, 17, 19, 20, 21, 23, 24, 26, 27, 28, 30, 31, 33, 34, 36, 37, 38, 40, 41, 43, 44, 45, 47, 48, 50, 51, 53, 54, 55, 57, 58, 60, 61, 62, 64, 65, 67, 68, 70, 71, 72, 74, 75, 77, 78, 79, 81, 82, 84, 85, 86, 88, 89, 91, 92, 94, 95
Offset: 0

Views

Author

Keywords

Comments

Let s(n) = zeta(3) - Sum_{k = 1..n} 1/k^3. Conjecture: for n >= 1, s(a(n)) < 1/n^2 < s(a(n)-1), and the difference sequence of A049473 consists solely of 0's and 1's, in positions given by the nonhomogeneous Beatty sequences A001954 and A001953, respectively. - Clark Kimberling, Oct 05 2014

References

  • 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

Complement of A001954.

Programs

  • Magma
    [Floor((2*n+1)/Sqrt(2)): n in [0..100]]; // G. C. Greubel, Nov 14 2019
    
  • Maple
    seq( floor((2*n+1)/sqrt(2)), n=0..100); # G. C. Greubel, Nov 14 2019
  • Mathematica
    Table[Floor[(n + 1/2) Sqrt[2]], {n, 0, 100}] (* T. D. Noe, Aug 17 2012 *)
  • PARI
    a(n)=floor((n+1/2)*sqrt(2))
    
  • PARI
    a(n)={sqrtint(2*n*(n+1))} \\ Andrew Howroyd, Oct 24 2019
    
  • Sage
    [floor((2*n+1)/sqrt(2)) for n in (0..100)] # G. C. Greubel, Nov 14 2019

Formula

From Ralf Steiner, Oct 23 2019: (Start)
a(n) = floor(2*sqrt(A000217(n))).
a(n) = A136119(n + 1) - 1.
a(n + 1) - a(n) is in {1,2}.
a(n + 3) - a(n) is in {4,5}. (End)

Extensions

More terms from Michael Somos, Apr 26 2000.

A137894 Limiting sequence when we start with positive integers (A000027) and at step n >= 1 add to the term at position n + a(n) the value n.

Original entry on oeis.org

1, 3, 3, 4, 7, 9, 7, 12, 9, 10, 11, 17, 13, 21, 21, 16, 17, 27, 19, 38, 21, 33, 23, 24, 25, 39, 27, 28, 41, 30, 31, 48, 33, 51, 49, 51, 37, 57, 39, 40, 41, 63, 43, 44, 63, 69, 47, 72, 49, 75, 51, 52, 53, 81, 77, 84, 57, 78, 59, 90, 61, 93, 63, 64, 91, 99, 67, 68, 69, 99
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 30 2008

Keywords

Crossrefs

Programs

  • Maple
    mx:= 10000: # maximal index needed
    b:= proc(n) n end:
    a:= proc(n) option remember; global mx; local h, t;
          if n=0 then 0 else a(n-1); t:= b(n);
            if n+t<=mx then h:=b(t+n); b(t+n):=h+n fi; t
          fi
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 04 2015
  • Mathematica
    mx = 10000 (* maximal index needed *); b[n_] := n; a[n_] := a[n] = Module[{h, t}, If[n == 0, 0, a[n-1]; t = b[n]; If[n+t <= mx, h = b[t+n]; b[t+n] = h+n]; t]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 24 2016, after Alois P. Heinz *)
  • Python
    TOP = 1000
    a = [1]*TOP
    for n in range(1,TOP):
      a[n]=n
    for n in range(1,TOP):
      print(str(a[n]),end=',')
      if n+a[n]Alex Ratushnyak, Nov 22 2013

Formula

Limiting sequence when we start with positive integers (A000027) and at step n >= 1 add to the term at position n + a(n) the value n.

Extensions

More terms from Alex Ratushnyak, Nov 22 2013.

A184118 Upper s(n)-Wythoff sequence, where s(n) = 2n + 1.

Original entry on oeis.org

4, 7, 10, 14, 17, 21, 24, 28, 31, 34, 38, 41, 45, 48, 51, 55, 58, 62, 65, 68, 72, 75, 79, 82, 86, 89, 92, 96, 99, 103, 106, 109, 113, 116, 120, 123, 127, 130, 133, 137, 140, 144, 147, 150, 154, 157, 161, 164, 168, 171, 174, 178, 181, 185, 188, 191, 195, 198, 202, 205, 208, 212, 215, 219, 222, 226, 229, 232, 236, 239, 243, 246, 249, 253, 256, 260, 263, 267, 270, 273, 277, 280, 284, 287, 290, 294, 297, 301, 304, 307, 311, 314, 318, 321, 325, 328, 331, 335, 338, 342
Offset: 1

Views

Author

Clark Kimberling, Jan 09 2011

Keywords

Comments

See A184117 (the lower s(n)-Wythoff sequence).

Crossrefs

Programs

  • Magma
    [Floor((2+Sqrt(2))*n+Sqrt(2)/2): n in [1..100]]; // Vincenzo Librandi, Jan 07 2019
  • Maple
    a:=n->floor((2+sqrt(2))*n+sqrt(2)/2): seq(a(n),n=1..80); # Muniru A Asiru, Jan 08 2019
  • Mathematica
    k=2; r=-1;
    mex:=First[Complement[Range[1, Max[#1]+1], #1]]&;
    S[n_]:=k n-r; A[1]=1; B[n_]:=B[n]=S[n]+A[n];
    A[n_]:=A[n]=mex[Flatten[Table[{A[i], B[i]}, {i, 1, n-1}]]];
    Table[S[n], {n, 30}]
    Table[A[n], {n, 100}]
    Table[B[n], {n, 100}]
    Table[Floor[(2 + Sqrt[2]) n + Sqrt[2] / 2], {n, 80}] (* Vincenzo Librandi, Jan 07 2019 *)
  • PARI
    A184118_upto(N,s(n)=2*n+1,U=[0],b=[])={until(b[#b]>=N, b=concat(b,s(1+#b)+U[1]+=1); U=setunion(U,[b[#b]]); while(#U>1&&U[2]==U[1]+1,U=U[^1]));b} \\ M. F. Hasler, Jan 07 2019
    

Formula

a(n) = A184117(n) + s(n) for all n. - M. F. Hasler, Jan 07 2019

A137832 Limiting sequence when we start with the positive integers (A000027) and delete in step n >= 1 the last digit in the term at position n + a(n).

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 10, 11, 1, 1, 1, 16, 1, 1, 1, 21, 2, 23, 2, 25, 2, 27, 2, 29, 3, 31, 3, 3, 34, 3, 3, 37, 3, 3, 40, 4, 43, 44, 45, 47, 48, 49, 5, 51, 52, 53, 5, 5, 56, 57, 5, 5, 6, 61, 6, 6, 6, 65, 6, 67, 69, 7, 7, 72, 7, 7, 75, 76, 7, 7, 79, 8, 82, 83, 84, 8
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 29 2008

Keywords

Examples

			First few steps are:
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
n = 1; delete the last digit in the term at position 1+a(1) = 2: 2;
1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
n = 2; delete the last digit in the term at position 2+a(2) = 5: 6;
1,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
n = 3; delete the last digit in the term at position 3+a(3) = 7: 9;
1,3,4,5,7,8,10,11,12,13,14,15,16,17,18,19,20,...
n = 4; delete the last digit in the term at position 4+a(4) = 9: 2;
1,3,4,5,7,8,10,11,1,13,14,15,16,17,18,19,20,...
n = 5; delete the last digit in the term at position 5+a(5) = 12: 5;
1,3,4,5,7,8,10,11,1,13,14,1,16,17,18,19,20,...
n = 6; delete the last digit in the term at position 6+a(6) = 14: 8;
1,3,4,5,7,8,10,11,1,13,14,1,16,17,1,19,20,...
		

Crossrefs

A137901 Limiting sequence when we start with positive integers (A000027) and at step n >= 1 add to the term at position n + a(n) the value 1.

Original entry on oeis.org

1, 3, 3, 4, 6, 7, 7, 9, 9, 10, 12, 12, 14, 15, 15, 16, 18, 19, 19, 21, 21, 22, 24, 25, 25, 26, 28, 28, 30, 31, 31, 33, 33, 34, 36, 36, 38, 39, 39, 40, 42, 43, 43, 45, 45, 46, 48, 48, 50, 51, 51, 53, 53, 54, 56, 57, 57, 58, 60, 60, 62, 63, 63, 64, 66, 67, 67, 69, 69, 70
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 30 2008

Keywords

Crossrefs

Programs

  • PARI
    lista(nn) = my(va = [1..nn]); for (n=1, nn, my(m = n+va[n]); if (m <= nn, va[m]++)); va; \\ Michel Marcus, Oct 29 2022

Formula

Limiting sequence when we start with positive integers (A000027) and at step n >= 1 add to the term at position n + a(n) the value 1.

Extensions

Entries corrected and extended by Paolo P. Lava, Mar 10 2009
More terms from Michel Marcus, Oct 29 2022
Showing 1-10 of 23 results. Next