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 12 results. Next

A003151 Beatty sequence for 1+sqrt(2); a(n) = floor(n*(1+sqrt(2))).

Original entry on oeis.org

2, 4, 7, 9, 12, 14, 16, 19, 21, 24, 26, 28, 31, 33, 36, 38, 41, 43, 45, 48, 50, 53, 55, 57, 60, 62, 65, 67, 70, 72, 74, 77, 79, 82, 84, 86, 89, 91, 94, 96, 98, 101, 103, 106, 108, 111, 113, 115, 118, 120, 123, 125, 127, 130, 132, 135, 137, 140, 142, 144
Offset: 1

Views

Author

Keywords

Comments

Numbers with an odd number of trailing 0's in their minimal representation in terms of the positive Pell numbers (A317204). - Amiram Eldar, Mar 16 2022
From Clark Kimberling, Dec 24 2022: (Start)
This is the first of four sequences that partition the positive integers. Starting with a general overview, suppose that u = (u(n)) and v = (v(n)) are increasing sequences of positive integers. Let u' and v' be their complements, and assume that the following four sequences are infinite:
(1) u ^ v = intersection of u and v (in increasing order);
(2) u ^ v';
(3) u' ^ v;
(4) u' ^ v'.
Every positive integer is in exactly one of the four sequences.
For A003151, u, v, u', v', are the Beatty sequences given by u(n) = floor(n*sqrt(2)) and v(n) = floor(((1+sqrt(2))/2)*n), so that r = sqrt(2), s = (1+sqrt(2))/2, r' = (2+sqrt(2))/2, s' = 1 + 1/sqrt(2).
Assume that if w is any of the sequences u, v, u', v', then lim_{n->oo} w(n)/n exists and defines the (limiting) density of w. For w = u,v,u',v', denote the densities by r,s,r',s'. Then the densities of sequences (1)-(4) exist, and 1/(r*r') + 1/(r*s') + 1/(s*s') + 1/(s*r') = 1.
(1) u ^ v = (2, 4, 7, 9, 12, 14, 16, 19, 21, 24, 26, 28, 31, 33, ...) = A003151
(2) u ^ v' = (1, 5, 8, 11, 15, 18, 22, 25, 29, 32, 35, 39, 42, ...) = A001954
(3) u' ^ v = (284, 287, 289, 292, 294, 296, 299, 301, 304, 306, ...) = A356135
(4) u' ^ v' = (3, 6, 10, 13, 17, 20, 23, 27, 30, 34, 37, 40, 44, ...) = A003152
For results of compositions instead of intersections, see A184922. (End)
The indices of the twice squares in the sequence of squares and twice squares: A028982(a(n)) = 2*n^2. - Amiram Eldar, Apr 13 2025

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A003152.
Equals A001951(n) + n.
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
Bisections: A197878, A215247.

Programs

  • Mathematica
    Table[Floor[n*(1 + Sqrt[2])], {n, 1, 50}] (* G. C. Greubel, Jul 02 2017 *)
  • PARI
    for(n=1,50, print1(floor(n*(1 + sqrt(2))), ", ")) \\ G. C. Greubel, Jul 02 2017
    
  • Python
    from math import isqrt
    def A003151(n): return n+isqrt(n*n<<1) # Chai Wah Wu, Aug 03 2022

Formula

a(1) = 2; for n>1, a(n+1) = a(n)+3 if n is already in the sequence, a(n+1) = a(n)+2 otherwise.

A003152 A Beatty sequence: a(n) = floor(n*(1+1/sqrt(2))).

Original entry on oeis.org

1, 3, 5, 6, 8, 10, 11, 13, 15, 17, 18, 20, 22, 23, 25, 27, 29, 30, 32, 34, 35, 37, 39, 40, 42, 44, 46, 47, 49, 51, 52, 54, 56, 58, 59, 61, 63, 64, 66, 68, 69, 71, 73, 75, 76, 78, 80, 81, 83, 85, 87, 88, 90, 92, 93, 95, 97, 99, 100, 102, 104, 105, 107, 109, 110, 112, 114, 116
Offset: 1

Views

Author

Keywords

Comments

Numbers with an even number of trailing 0's in their minimal representation in terms of the positive Pell numbers (A317204). - Amiram Eldar, Mar 16 2022
The indices of the squares in the sequence of squares and twice squares: A028982(a(n)) = n^2. - Amiram Eldar, Apr 13 2025

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A003151.
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
Bisections: A001952, A001954.

Programs

  • Magma
    [Floor(n*(1+1/Sqrt(2))): n in [1..70]]; // Vincenzo Librandi, Dec 26 2015
    
  • Maple
    Digits := 100: t := evalf(1+sin(Pi/4)): A:= n->floor(t*n): seq(floor((t*n)),n=1..68); # Zerinvary Lajos, Mar 27 2009
  • Mathematica
    Table[Floor[n (1 + 1/Sqrt[2])], {n, 70}] (* Vincenzo Librandi, Dec 26 2015 *)
  • PARI
    a(n)=n+sqrtint(2*n^2)\2 \\ Charles R Greathouse IV, Jan 25 2022
    
  • Python
    from math import isqrt
    def A003152(n): return n+isqrt(n**2>>1) # Chai Wah Wu, May 24 2025

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

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 10, 11, 13, 14, 15, 17, 18, 20, 21, 22, 24, 25, 27, 28, 29, 31, 32, 34, 35, 37, 38, 39, 41, 42, 44, 45, 46, 48, 49, 51, 52, 54, 55, 56, 58, 59, 61, 62, 63, 65, 66, 68, 69, 71, 72, 73, 75, 76, 78, 79, 80, 82, 83, 85, 86, 87, 89, 90, 92, 93, 95, 96, 97, 99, 100
Offset: 1

Views

Author

Ctibor O. Zizka, Mar 16 2008

Keywords

Comments

Apparently a(n) = A001953(n-1)+1 = floor((n-1/2)*sqrt(2))+1 (confirmed for n < 20000) and a(n+1) - a(n) = A001030(n). From the definitions these conjectures are by no means obvious. Can they be proved? - Klaus Brockhaus, Apr 15 2008 [For an affirmative answer, see the Cloitre link.]
This is the s(n)-Wythoff sequence for s(n)=2n-1; see A184117 for the definition. Complement of A184119. - Clark Kimberling, Jan 09 2011

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 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 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 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 term at position 4+a(4) = 9: 12;
1,3,4,5,7,8,10,11,13,14,15,16,17,18,19,20,...
n = 5; delete term at position 5+a(5) = 12: 16;
1,3,4,5,7,8,10,11,13,14,15,17,18,19,20,...
n = 6; delete term at position 6+a(6) = 14: 19;
1,3,4,5,7,8,10,11,13,14,15,17,18,20,...
		

References

  • B. Cloitre, The golden sieve, preprint 2008

Crossrefs

Cf. A000027, A001953 (floor((n+1/2)*sqrt(2))), A001030 (fixed under 1 -> 21, 2 -> 211), A136110, A137292.
Cf. A242535.
Cf. A000217 (T).

Programs

  • Haskell
    import Data.List (delete)
    a136119 n = a136119_list !! (n-1)
    a136119_list = f [1..] where
       f zs@(y:xs) = y : f (delete (zs !! y) xs)
    -- Reinhard Zumkeller, May 17 2014
    
  • Magma
    [Ceiling((n-1/2)*Sqrt(2)): n in [1..100]]; // Vincenzo Librandi, Jul 01 2019
    
  • Mathematica
    f[0] = Range[100]; f[n_] := f[n] = Module[{pos = n + f[n-1][[n]]}, If[pos > Length[f[n-1]], f[n-1], Delete[f[n-1], pos]]]; f[1]; f[n = 2]; While[f[n] != f[n-1], n++]; f[n] (* Jean-François Alcover, May 08 2019 *)
    T[n_] := n (n + 1)/2; Table[1 + 2 Sqrt[T[n-1]] , {n, 1, 71}] // Floor (* Ralf Steiner, Oct 23 2019 *)
  • PARI
    apply( {A136119(n)=sqrtint(n*(n-1)*2)+1}, [1..99]) \\ M. F. Hasler, Jul 04 2022

Formula

a(n) = ceiling((n-1/2)*sqrt(2)). This can be proved in the same way as the formula given for A099267. There are some generalizations. For instance, it is possible to consider "a(n)+K*n" instead of "a(n)+n" for deleting terms where K=0,1,2,... is fixed. The constant involved in the Beatty sequence for the sequence of deleted terms then depends on K and equals (K + 1 + sqrt((K+1)^2 + 4))/2. K=0 is related to A099267. 1+A001954 is the complement sequence of this sequence A136119. - Benoit Cloitre, Apr 18 2008
a(n) = floor(1 + 2*sqrt(T(n-1))), with triangular numbers T(). - Ralf Steiner, Oct 23 2019
Lim_{n->inf}(a(n)/(n - 1)) = sqrt(2), with {a(n)/(n - 1)} decreasing. - Ralf Steiner, Oct 24 2019

Extensions

Edited and extended by Klaus Brockhaus, Apr 15 2008
An incorrect g.f. removed by Alois P. Heinz, Dec 14 2012

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.

A049473 Nearest integer to n/sqrt(2).

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 28, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 47
Offset: 0

Views

Author

Keywords

Comments

a(n) = floor(n*sqrt(2)) - floor(n/sqrt(2)). Indeed, the equation {(nearest integer to n/r) = floor(nr) - floor(n/r) for all n>=0} has exactly two solutions: sqrt(2) and -sqrt(2). - Clark Kimberling, Dec 18 2003
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, in positions given by the nonhomogeneous Beatty sequences A001954 and A001953, respectively. - Clark Kimberling, Oct 05 2014

Crossrefs

Cf. A091087.

Programs

A001963 Winning positions in the u-pile of the 4-Wythoff game with i=1.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 38, 39, 41, 42, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 55, 57, 58, 59, 60, 62, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 75, 76, 78, 79, 80, 81, 83
Offset: 0

Views

Author

Keywords

Comments

See Connell (1959) for further information.

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

Programs

  • Mathematica
    Table[Floor[(n + 1/4)*(Sqrt[5] - 1)], {n, 0, 100}] (* T. D. Noe, Aug 17 2012 *)

Formula

a(n) = floor( (n+1/4)*(sqrt(5)-1) ). - R. J. Mathar, Feb 14 2011

Extensions

Edited by Hugo Pfoertner, Dec 27 2021

A001960 a(n) = floor((n+2/3)*(5+sqrt(13))/2); v-pile positions in the 3-Wythoff game.

Original entry on oeis.org

2, 7, 11, 15, 20, 24, 28, 32, 37, 41, 45, 50, 54, 58, 63, 67, 71, 76, 80, 84, 88, 93, 97, 101, 106, 110, 114, 119, 123, 127, 131, 136, 140, 144, 149, 153, 157, 162, 166, 170, 174, 179, 183, 187, 192, 196, 200, 205, 209, 213, 218, 222, 226, 230, 235, 239, 243, 248
Offset: 0

Views

Author

Keywords

Comments

3-Wythoff game, i=2, the v-pile positions in the Connell terminology. - R. J. Mathar, Feb 14 2011

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 A001957.

Programs

  • Mathematica
    Table[Floor[(n + 2/3)*(5 + Sqrt[13])/2], {n, 0, 100}] (* T. D. Noe, Aug 17 2012 *)

Formula

a(n) = floor((n+2/3)*(5+sqrt(13))/2). - R. J. Mathar, Feb 14 2011

Extensions

New name from Hugo Pfoertner, Dec 27 2021

A001959 u-pile numbers for the 3-Wythoff game with i=2.

Original entry on oeis.org

0, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 21, 23, 24, 25, 26, 28, 29, 30, 32, 33, 34, 36, 37, 38, 39, 41, 42, 43, 45, 46, 47, 49, 50, 51, 52, 54, 55, 56, 58, 59, 60, 62, 63, 64, 66, 67, 68, 69, 71, 72, 73, 75, 76, 77, 79, 80, 81, 82, 84, 85, 86, 88
Offset: 0

Views

Author

Keywords

Comments

See Connell (1959) for further information.

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Table[Floor[(n + 2/3)*(Sqrt[13] - 1)/2], {n, 0, 100}] (* T. D. Noe, Aug 17 2012 *)

Formula

a(n) = floor( (n+2/3)*(sqrt(13)-1)/2 ). - R. J. Mathar, Feb 14 2011

Extensions

Edited by Hugo Pfoertner, Dec 27 2021

A383032 Exponent of the highest power of 2 dividing the n-th number that is either a square or twice a square.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Apr 13 2025

Keywords

Comments

The first position of k in this sequence, for k >= 0, is A001521(k+1).

Crossrefs

Programs

  • Mathematica
    With[{m = 3000}, IntegerExponent[Union[Join[Range[Floor[Sqrt[m]]]^2, 2*Range[Floor[Sqrt[m/2]]]^2]], 2]]
  • PARI
    lista(nn) = apply(x->valuation(x,2), vecsort(concat(vector(sqrtint(nn\1), i, i^2), vector(sqrtint(nn\2), i, 2*i^2)))); \\ Michel Marcus, Apr 13 2025

Formula

a(n) = A007814(A028982(n)).
a(A001954(n)) = 0 for n >= 0.
a(A215247(n)) = 1 for n >= 1.
a(A342280(n)) = 2 for n >= 0.
Sum_{k=1..n} a(k) ~ (1 + sqrt(2)) * n.

A001957 u-pile positions in the 3-Wythoff game with i=1.

Original entry on oeis.org

0, 1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 33, 34, 35, 36, 38, 39, 40, 42, 43, 44, 46, 47, 48, 49, 51, 52, 53, 55, 56, 57, 59, 60, 61, 62, 64, 65, 66, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87
Offset: 0

Views

Author

Keywords

Comments

See Connell (1959) for further information.
The complement is A001960. - Omar E. Pol, Jan 06 2009

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

Programs

  • Mathematica
    Table[Floor[(n + 1/3)*(Sqrt[13] - 1)/2], {n, 0, 100}] (* T. D. Noe, Aug 17 2012 *)

Formula

a(n) = floor((n+1/3)*(sqrt(13)-1)/2). - R. J. Mathar, Feb 14 2011

Extensions

Edited by N. J. A. Sloane, Dec 27 2021
Showing 1-10 of 12 results. Next