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-9 of 9 results.

A004202 Skip 1, take 1, skip 2, take 2, skip 3, take 3, etc.

Original entry on oeis.org

2, 5, 6, 10, 11, 12, 17, 18, 19, 20, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 50, 51, 52, 53, 54, 55, 56, 65, 66, 67, 68, 69, 70, 71, 72, 82, 83, 84, 85, 86, 87, 88, 89, 90, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132
Offset: 1

Views

Author

Alexander Stasinski

Keywords

Comments

a(n) are the numbers satisfying m < sqrt(a(n)) < m + 0.5 for some integer m. - Floor van Lamoen, Jul 24 2001
a(A000217(n)) = A002378(n). [Reinhard Zumkeller, Feb 12 2011]
Complement of A004201. Upper s(n)-Wythoff sequence (as defined in A184117), for s(n)=A002024(n)=floor[1/2+sqrt(2n)]. I.e., A004202(n) = A002024(n) + A004201(n), with A004201(1)=1 and for n>1, A004201(n) = least positive integer not yet in (A004201(1..n-1) union A004202(1..n-1)). - M. F. Hasler (following observations from R. J. Mathar), Feb 13 2011
Positions of record values in A256188 that are greater than 1: A014132(n) = A256188(a(n)). - Reinhard Zumkeller, Mar 26 2015

Examples

			Interpretation as  Wythoff sequence (from _Clark Kimberling_):
s = (1,2,2,3,3,3,4,4,4,4...) = A002024 (n n's);
a = (1,3,4,7,8,9,13,14,...) = A004201 = least number > 0 not yet in a or b;
b = (2,5,6,10,11,12,17,18,...) = A004202 = a+s.
From _Michael Somos_, May 03 2019: (Start)
As a triangular array
  2;
  5,  6;
  10, 11, 12;
  17, 18, 19, 20;
(End)
		

Crossrefs

Programs

  • Haskell
    a004202 n = a004202_list !! (n-1)
    a004202_list = skipTake 1 [1..] where
       skipTake k xs = take k (drop k xs) ++ skipTake (k + 1) (drop (2*k) xs)
    -- Reinhard Zumkeller, Feb 12 2011
    
  • Mathematica
    a = Table[n, {n, 1, 210} ]; b = {}; Do[a = Drop[a, {1, n} ]; b = Append[b, Take[a, {1, n} ]]; a = Drop[a, {1, n} ], {n, 1, 14} ]; Flatten[b]
    a[ n_] := If[ n < 1, 0, With[{m = Round@Sqrt[2 n]}, n + m (m + 1)/2]]; (* Michael Somos, May 03 2019 *)
    Take[#,(-Length[#])/2]&/@Module[{nn=20},TakeList[Range[ nn+nn^2],2*Range[ nn]]]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 13 2019 *)
  • PARI
    A004202(n) = n+0+(n=(sqrtint(8*n-7)+1)\2)*(n+1)\2  \\ M. F. Hasler, Feb 13 2011
    
  • PARI
    {a(n) = my(m); if( n<1, 0, m=round(sqrt(2*n)); n + m*(m+1)/2)}; /* Michael Somos, May 03 2019 */
    
  • Python
    from math import isqrt, comb
    def A004202(n): return n+comb((m:=isqrt(k:=n<<1))+(k-m*(m+1)>=1)+1,2) # Chai Wah Wu, Jun 19 2024

Formula

a(n) = n + A000217(A002024(n)). - M. F. Hasler, Feb 13 2011
T(n, k) = n^2 + k, for n>=1, k>=1 as a triangular array. a(n) = n + A127739(n). - Michael Somos, May 03 2019

A007607 Skip 1, take 2, skip 3, etc.

Original entry on oeis.org

2, 3, 7, 8, 9, 10, 16, 17, 18, 19, 20, 21, 29, 30, 31, 32, 33, 34, 35, 36, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130
Offset: 1

Views

Author

Keywords

Comments

Numbers k with the property that the smallest Dyck path of the symmetric representation of sigma(k) has a central peak. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
Union of A317303 and A014105. - Omar E. Pol, Aug 29 2018

Examples

			From _Omar E. Pol_, Aug 29 2018: (Start)
Written as an irregular triangle in which the row lengths are the nonzero even numbers the sequence begins:
    2,   3;
    7,   8,   9,  10;
   16,  17,  18,  19,  20,  21;
   29,  30,  31,  32,  33,  34,  35,  36;
   46,  47,  48,  49,  50,  51,  52,  53,  54,  55;
   67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,  78;
   92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103, 104, 105;
  121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136;
...
Row sums give the nonzero terms of A317297.
Column 1 gives A130883, n >= 1.
Right border gives A014105, n >= 1.
(End)
		

References

  • R. Honsberger, Mathematical Gems III, M.A.A., 1985, p. 177.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A007606.
Similar to A360418.

Programs

  • Haskell
    a007607 n = a007607_list !! (n-1)
    a007607_list = skipTake 1 [1..] where
       skipTake k xs = take (k + 1) (drop k xs)
                       ++ skipTake (k + 2) (drop (2*k + 1) xs)
    -- Reinhard Zumkeller, Feb 12 2011
    
  • Haskell
    a007607_list' = f $ tail $ scanl (+) 0 [1..] where
       f (t:t':t'':ts) = [t+1..t'] ++ f (t'':ts)
    -- Reinhard Zumkeller, Feb 12 2011
  • Mathematica
    Flatten[ Table[i, {j, 2, 16, 2}, {i, j(j - 1)/2 + 1, j(j + 1)/2}]] (* Robert G. Wilson v, Mar 11 2004 *)
    With[{t=20},Flatten[Take[TakeList[Range[(t(t+1))/2],Range[t]],{2,-1,2}]]] (* Harvey P. Dale, Sep 26 2021 *)
  • PARI
    for(m=0,10,for(n=2*m^2+3*m+2,2*m^2+5*m+3,print1(n", "))) \\ Charles R Greathouse IV, Feb 12 2011
    

Formula

G.f.: 1/(1-x) * (1/(1-x) + x*Sum_{k>=1} (2k+1)*x^(k*(k+1))). - Ralf Stephan, Mar 03 2004
a(A000290(n)) = A001105(n). - Reinhard Zumkeller, Feb 12 2011
A057211(a(n)) = 0. - Reinhard Zumkeller, Dec 30 2011
a(n) = floor(sqrt(n) + 1/2)^2 + n = A053187(n) + n. - Ridouane Oudra, May 04 2019

A136272 Waterbird take-off sequence. Complement of A166021.

Original entry on oeis.org

1, 3, 6, 7, 11, 12, 13, 18, 19, 20, 21, 27, 28, 29, 30, 31, 38, 39, 40, 41, 42, 43, 51, 52, 53, 54, 55, 56, 57, 66, 67, 68, 69, 70, 71, 72, 73, 83, 84, 85, 86, 87, 88, 89, 90, 91, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 123, 124, 125, 126, 127, 128, 129
Offset: 1

Views

Author

Ctibor O. Zizka, Mar 19 2008

Keywords

Comments

This kind of sequence can be generalized as follows:
Let F(t), G(t) be arithmetic functions: F(t) the right hand move, G(t) the number of erased positions.
Then starting from the position t=1 do procedure:
JUMP F(t) positions right hand
ERASE G(t) positions
SET t=t+1
repeat procedure from the last erased position.
This sequence has F(t)=t, G(t)=t.
We can use a set of functions F_i(t) and G_i(t) processed in parallel (a flock of birds taking off).

Examples

			1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,...
t=1; from the position 1 go 1 position to the right, erase 1 position:
1..3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,...
t=2; from the last erased position go 2 positions to the right, erase 2 positions:
1..3..,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,...
t=3; from the last erased position go 3 positions to the right, erase 3 positions:
1..3..,6,7....11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,...
t=4; from the last erased position go 4 positions to the right, erase 4 positions:
1..3..,6,7....11,12,13....,18,19,20,21,22,23,24,25,26,27,...
t=5; from the last erased position go 5 positions to the right, erase 5 positions:
1..3..,6,7....11,12,13....,18,19,20,21......27,...
The erased positions form the complement of this sequence: A166021.
		

Crossrefs

Programs

Formula

a(0)=1; let t=1. Start on position t. Jump t positions right hand. Erase t positions. (*P*) Set t=t+1. Start on the last erased position. Jump t positions right hand. Erase t positions. Repeat procedure (*P*).

Extensions

Edited and corrected by Antti Karttunen, Oct 05 2009

A061885 n + largest triangular number less than or equal to n.

Original entry on oeis.org

0, 2, 3, 6, 7, 8, 12, 13, 14, 15, 20, 21, 22, 23, 24, 30, 31, 32, 33, 34, 35, 42, 43, 44, 45, 46, 47, 48, 56, 57, 58, 59, 60, 61, 62, 63, 72, 73, 74, 75, 76, 77, 78, 79, 80, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 132
Offset: 0

Views

Author

Henry Bottomley, May 12 2001

Keywords

Comments

A253607(a(n)) > 0. - Reinhard Zumkeller, Jan 05 2015
Also possible values of floor(x*floor(x)) for real x < 1. - Jianing Song, Feb 16 2021

Examples

			a(9) = 9+6 = 15;
a(10) = 10+10 = 20;
a(11) = 11+10 = 21.
		

Crossrefs

Cf. A060985.
Cf. A064801 (complement), A253607.

Programs

  • Haskell
    a061885 n = n + a057944 n  -- Reinhard Zumkeller, Feb 03 2012
    
  • Python
    from math import comb, isqrt
    def A061885(n): return n+comb((m:=isqrt(k:=n+1<<1))+(k>m*(m+1)),2) # Chai Wah Wu, Nov 09 2024

Formula

a(n) = n+A057944(n) = 2n-A002262(n) = n+[(sqrt(1+8*n)-1)/2]*[(sqrt(1+8*n)+1)/2]/2.
a(n) = A004201(n+1) - 1. - Franklin T. Adams-Watters, Jul 05 2009

A253607 First differences of A253580, when the tree is seen as flattened list.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 05 2015

Keywords

Comments

a(n) != 0 and -2 <= a(n) <= +2.
a(n) = 1 iff A253580(n+1) = A253580(n) + 1, marked with X in the table below, where also the erasure of pairs of consecutive terms in A253580 is illustrated;
a(A005563(n)) = 1; a(A028387(n)) = -1;
a(A061885(n)) > 0; a(A064801(n)) < 0.

Examples

			.   n | A253580(n) | a(n) | erased | reappearing
.  ---+------------+------+--------+-------------
.   0 |    X    0  |   1  |      0 |
.   1 |    X    1  |  -1  |      1 |
.   2 |         0  |   2  |        |           0
.   3 |    X    2  |   1  |      2 |
.   4 |    X    3  |  -2  |      3 |
.   5 |         1  |  -1  |        |           1
.   6 |         0  |   2  |        |           0
.   7 |         2  |   2  |        |           2
.   8 |    X    4  |   1  |      4 |
.   9 |    X    5  |  -2  |      5 |
.  10 |         3  |  -2  |        |           3
.  11 |         1  |  -1  |        |           1
.  12 |         0  |   2  |        |           0
.  13 |         2  |   2  |        |           2
.  14 |         4  |   2  |        |           4
.  15 |    X    6  |   1  |      6 |
.  16 |    X    7  |  -2  |      7 |
.  17 |         5  |  -2  |        |           5
.  18 |         3  |  -2  |        |           3
.  19 |         1  |  -1  |        |           1
.  20 |         0  |   2  |        |           0
.  21 |         2  |   2  |        |           2
.  22 |         4  |   2  |        |           4
.  23 |         6  |   2  |        |           6
.  24 |    X    8  |   1  |      8 |
.  25 |    X    9  |  -2  |      9 |             .
		

Crossrefs

Programs

  • Haskell
    a253607 n = a253607_list !! n
    a253607_list = zipWith (-) (tail a253580_list) a253580_list

A048859 A sieve: keep the first 2 numbers, delete the next 3 numbers; keep the next 3 numbers, delete the next 4 numbers; keep the next 4 numbers, delete the next 5 numbers; and so on. In other words, keep the next k numbers and delete the next k+1 numbers, for k = 2, 3, ...

Original entry on oeis.org

1, 2, 6, 7, 8, 13, 14, 15, 16, 22, 23, 24, 25, 26, 33, 34, 35, 36, 37, 38, 46, 47, 48, 49, 50, 51, 52, 61, 62, 63, 64, 65, 66, 67, 68, 78, 79, 80, 81, 82, 83, 84, 85, 86, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Charles T. Le (charlestle(AT)yahoo.com)

Keywords

Examples

			List the natural numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ...
Keep the first two numbers 1, 2 and delete the next three numbers 3, 4, 5.
Keep the next three numbers 6, 7, 8 and delete the next four numbers 9, 10, 11, 12. And so on.
		

References

  • C. Dumitrescu & V. Seleacu, editors, Some Notions and Questions in Number Theory, Vol. I, Erhus Publ., Glendale, 1994.
  • M. Le, On the Smarandache n-ary Sieve, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 146-147.
  • F. Smarandache, Properties of Numbers, 1972.

Crossrefs

Programs

  • Haskell
    a048859 n = a048859_list !! (n-1)
    a048859_list = f 2 [1..] where
       f k xs = us ++ f (k + 1) (drop (k + 1) vs)
                where (us, vs) = splitAt k xs
    -- Reinhard Zumkeller, May 16 2014
  • Mathematica
    ss[n_]:=Module[{c=n^2+4n+1},Range[c,c+n+1]]; Flatten[Array[ss,10,0]] (* Harvey P. Dale, Sep 10 2014 *)

Extensions

Corrected and revised by the author, Mar 24 2004
More terms from Bernardo Boncompagni Jul 27 2004
Offset changed by Reinhard Zumkeller, May 16 2014

A079643 a(n) = floor(n/floor(sqrt(n))).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jan 31 2003

Keywords

Comments

a(n) > a(n+1) iff n = m^2 - 1 with m >= 2; that is the answer to the 4th problem of the 32nd British Mathematical Olympiad (1996) [See link BMO]. - Bernard Schott, Oct 28 2019

References

  • A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Pb 4 pp. 54 and 92-93 (1996).

Crossrefs

Programs

  • Mathematica
    Table[Floor[n/Floor[Sqrt[n]]],{n,100}] (* Harvey P. Dale, Sep 22 2011 *)
  • PARI
    a(n)=floor(n/sqrtint(n))
    
  • Python
    from math import isqrt
    def a(n): return n//isqrt(n)
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, May 25 2025

Formula

a(A064801(n)) = sqrtint(A064801(n)); a(A005563(n)) = 2+sqrtint(sqrt(A005563(n))).
For m = positive integer, terms a(m^2) through a(m^2+m-1) each equal m; terms a(m^2+m) through a(m^2+2m-1) each equal m+1; term a(m^2+2m) equals m+2. - Leroy Quet, Apr 02 2007
a(n) = floor(2*sqrt(n+1)) - floor(sqrt(n)). - Wesley Ivan Hurt, Dec 25 2020
From Natalia L. Skirrow, May 13 2025: (Start)
G.f.: (t_3(x)-1)/(2*x) + psi(x^2)/(1-x) - 2, where t_3(x) (A000122) is Jacobi's third theta function and psi(x) is Ramanujan's psi function.
a(n) = A010052(n+1) + A000194(n+1) = [m is square] + floor((sqrt(4*m)+1)/2) where m=n+1 and [] is the Iverson bracket.
(End)

A079632 a(n) = floor(n/floor(sqrt(n)))-floor(sqrt(n)).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jan 30 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Floor[n/Floor[Sqrt[n]]]-Floor[Sqrt[n]],{n,110}] (* Harvey P. Dale, Feb 04 2016 *)
  • PARI
    a(n)=floor(n/sqrtint(n))-sqrtint(n)

Formula

a(A064801(n))=0; a(A005563(n))=2.

A343149 Floor-powerfree numbers: positive integers not expressible as a (nontrivially) nested floor function using the same positive real slope throughout the nesting.

Original entry on oeis.org

2, 3, 6, 7, 15, 23, 24, 44, 47, 48, 56, 57, 58, 59, 60, 61, 62, 63, 79, 97, 98, 113, 143, 167, 184, 185, 186, 210, 211, 212, 213, 214, 215, 222, 223, 247, 287, 320, 321, 356, 381, 462, 463, 474, 475, 481, 482, 483, 507, 508, 520, 521, 522, 553, 559, 604, 623
Offset: 1

Views

Author

J. Parker Shectman, Apr 06 2021

Keywords

Comments

Any of these integers can be expressed by a composition of floor functions f(n) = [mu*n] and g(n) = [nu*n], provided that the composition applies at least one f(n) and one g(n), for an irrational slope 1 < mu < 2 and its conjugate nu = 1/(1-1/mu). This follows from the Rayleigh-Beatty theorem. See reference in link. A064801 gives "floor squares."

Examples

			Example (of calculation by sieve, see reference in link, p. 221): The first term, 2, while given by the (un-nested) floor [mu] of a real slope 2 <= mu < 3, is too big to result from a twice-nested floor [[mu]mu], thrice-nested floor [mu[mu[mu]]], etc. for mu < 2. Yet for mu >= 2, the integer 2 is too small to result from a twice-nested, thrice-nested, etc. floor. Sequence A064801 = 1,4,5,9,... gives the "floor squares" - positive integers that are expressible as the twice-nested floor [mu[mu]] for a positive real slope mu. Thus 2,3,6,7 and 8 are not "floor squares". Besides 0 and 1, the next smallest integer obtainable from nesting a floor function with real positive slope t times is 2^t. Thus, the sequence of positive "floor cubes" starts with 1 and continues 8,9,12,13,14,27,... Hence, the first level of the sieve catches the floor squares 1,4,5,9,..., the second level of the sieve catches the floor cubes 1,8,... So, 2,3,6, and 7 are the initial floor-powerfree numbers passing the sieve for all t >= 2.
		

Crossrefs

Cf. A064801.

Programs

  • Mathematica
    (*Define the nested floor function.*)
    NestedFloor[slope_, t_] := Nest[Function[Floor[#*slope]], 1, t]
    (*Specify an upper bound on a(n) in DATA.*)
    aMax = 1017;
    (*Calculate the number of floor powers that must be sifted out.*)
    tMax = Ceiling[Log[2, aMax]];
    (*Initialize slopes for each floor power.*)
    slopes = Table[{1}, {tMax}]; slopes[[1]] = Table[n, {n, 1, aMax}];
    (*Initialize "floor-powerful" numbers for each floor power.*)
    powerfuls = Table[{1}, {tMax}]; powerfuls[[1]] = Table[n, {n, 1, aMax}];
    Do[n = 2; While[Last[powerfuls[[t]]] < aMax,
      (*Include slopes from previously sifted power as coarse slopes.*) coarseSlope = slopes[[t - 1]][[n]]; AppendTo[slopes[[t]], coarseSlope]; AppendTo[powerfuls[[t]], NestedFloor[coarseSlope, t]];
      (*Generate fine slopes between the coarse slopes; use floor-powerful numbers from previously sifted floor power as denominators q, start with a numerator p that gives the least fine slope exceeding the current coarse one*) q = powerfuls[[t - 1]][[n]]; p = Floor[coarseSlope*q] + 1; fineSlope = p/q;
      (*Insert fine slope(s) (if any) between the current coarse slope and the next smallest one.*) nextCoarse = slopes[[t - 1]][[n + 1]]; While[fineSlope < nextCoarse, AppendTo[slopes[[t]], fineSlope]; AppendTo[powerfuls[[t]], NestedFloor[fineSlope, t]]; p++; fineSlope = p/q;]; n++], {t, 2, tMax}]
    (*Sift out all floor-powerful numbers to output the floor-powerfree numbers, a(n)*)
    Complement[Table[n, {n, 1, aMax}], Union[Flatten[Rest[powerfuls]]]]
Showing 1-9 of 9 results.