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

A004201 Accept one, reject one, accept two, reject two, ...

Original entry on oeis.org

1, 3, 4, 7, 8, 9, 13, 14, 15, 16, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 36, 43, 44, 45, 46, 47, 48, 49, 57, 58, 59, 60, 61, 62, 63, 64, 73, 74, 75, 76, 77, 78, 79, 80, 81, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 133, 134, 135
Offset: 1

Views

Author

Alexander Stasinski

Keywords

Comments

a(n) are the numbers satisfying m - 0.5 < sqrt(a(n)) <= m for some positive integer m. - Floor van Lamoen, Jul 24 2001
Lower s(n)-Wythoff sequence (as defined in A184117) associated to s(n) = A002024(n) = floor(1/2+sqrt(2n)), with complement (upper s(n)-Wythoff sequence) in A004202.

Crossrefs

Programs

  • Haskell
    a004201 n = a004201_list !! (n-1)
    a004201_list = f 1 [1..] where
       f k xs = us ++ f (k + 1) (drop (k) vs) where (us, vs) = splitAt k xs
    -- Reinhard Zumkeller, Jun 20 2015, Feb 12 2011
    
  • Mathematica
    f[x_]:=Module[{c=1-x+x^2},Range[c,c+x-1]]; Flatten[Array[f,20]] (* Harvey P. Dale, Jul 31 2012 *)
  • PARI
    A004201(n)=n+(n=(sqrtint(8*n-7)+1)\2)*(n-1)\2  \\ M. F. Hasler, Feb 13 2011
    
  • Python
    from math import comb, isqrt
    def A004201(n): return n+comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)),2) # Chai Wah Wu, Nov 09 2024

Formula

a(n) = A061885(n-1)+1. - Franklin T. Adams-Watters, Jul 05 2009
a(n+1) - a(n) = A130296(n+1). - Reinhard Zumkeller, Jul 16 2008
a(A000217(n)) = n^2. - Reinhard Zumkeller, Feb 12 2011
a(n) = A004202(n)-A002024(n). - M. F. Hasler, Feb 13 2011
a(n) = n+A000217(A003056(n-1)) = n+A000217(A002024(n)-1). - M. F. Hasler, Feb 13 2011
a(n) = n + t(t+1)/2, where t = floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 13 2012
a(n) = (2*n - r + r^2)/2, where r = round(sqrt(2*n)). - Wesley Ivan Hurt, Sep 20 2021

A064801 Take 1, skip 2, take 2, skip 3, take 3, etc.

Original entry on oeis.org

1, 4, 5, 9, 10, 11, 16, 17, 18, 19, 25, 26, 27, 28, 29, 36, 37, 38, 39, 40, 41, 49, 50, 51, 52, 53, 54, 55, 64, 65, 66, 67, 68, 69, 70, 71, 81, 82, 83, 84, 85, 86, 87, 88, 89, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 121, 122, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Robert G. Wilson v, Oct 21 2001

Keywords

Comments

A253607(a(n)) < 0. - Reinhard Zumkeller, Jan 05 2015
Integers m such that A000196(m) = A079643(m). - Firas Melaih, Dec 10 2020
Also possible values of floor(x*floor(x)) for real x >= 1. - Jianing Song, Feb 16 2021

Crossrefs

Cf. A061885 (complement), A253607.
Cf. A136272.

Programs

  • Haskell
    a064801 n = a064801_list !! (n-1)
    a064801_list = f 1 [1..] where
       f k xs = us ++ f (k + 1) (drop (k + 1) vs)
                where (us, vs) = splitAt k xs
    -- Reinhard Zumkeller, May 16 2014
    
  • Maple
    seq(`if`(floor(sqrt(k)) * (floor(sqrt(k)) + 1) > k, k, NULL), k = 0..2034); # a(1)..a(1000), Rainer Rosenthal, Jul 19 2024
  • Mathematica
    a = Table[n, {n, 0, 200} ]; b = {}; Do[a = Drop[a, {1, n} ]; b = Append[b, Take[a, {1, n} ]]; a = Drop[a, {1, n} ], {n, 1, 14} ]; Flatten[b]
    Flatten[Table[Range[n^2,n^2+n-1],{n,12}]] (* Harvey P. Dale, Dec 18 2015 *)
  • PARI
    { n=0; for (m=1, 10^9, s=m^2; a=0; for (k=0, m - 1, a=s+k; write("b064801.txt", n++, " ", a); if (n==1000, return)) ) } \\ Harry J. Smith, Sep 26 2009
    
  • Python
    from math import isqrt  # after Rainer Rosenthal
    def isA(k: int): return k < ((s:=isqrt(k)) * (s + 1))
    print([k for k in range(129) if isA(k)]) # Peter Luschny, Jul 19 2024

Formula

a(n) = A004202(n) - 1.
Can be interpreted as a table read by rows: T(n,k) = n^2 + k, 0 <= k < n. T(n,k) = 0 iff k > A000196(n); T(n,0) = A000290(n); T(n,1) = A002522(n) for n > 1; T(n,2) = A010000(n) = A059100(n) for n > 2; T(n, n-3) = A014209(n-1) for n > 2; T(n, n-2) = A028552(n) for n > 1; T(n, n-1) = A028387(n-1); T(2*n+1, n) = A001107(n+1). - Reinhard Zumkeller, Nov 18 2003
Numbers k such that floor(sqrt(k)) * (floor(sqrt(k)) + 1) > k. - Rainer Rosenthal, Jul 19 2024

A160378 a(n) = n^3 - n*(n+1)/2.

Original entry on oeis.org

0, 0, 5, 21, 54, 110, 195, 315, 476, 684, 945, 1265, 1650, 2106, 2639, 3255, 3960, 4760, 5661, 6669, 7790, 9030, 10395, 11891, 13524, 15300, 17225, 19305, 21546, 23954, 26535, 29295, 32240, 35376, 38709, 42245, 45990, 49950, 54131, 58539
Offset: 0

Views

Author

Gil Broussard, May 11 2009

Keywords

Comments

n-th cube (A000578(n)) minus n-th triangular number (A000217(n)).
Partial sums of A045944. - Vladimir Joseph Stephan Orlovsky, Jun 25 2009
The sum of the n-1 numbers between n^2 and n*(n+1) = a(n). - J. M. Bergot, Apr 15 2013
Use the terms in A061885 to form the antidiagonals for an array. The antidiagonals begin: 0;2,3;6,7,8;12,13,14,15;20,21,22,23,24,25. The sum of the terms in these antidiagonals = a(n)for n > 0. - J. M. Bergot, Jul 08 2013
a(n) is the sum of the n numbers strictly between n^2-n-1 and n^2. - Charlie Marion, Feb 21 2020

Examples

			a(4) = 4^3 - 4*5/2 = 64 - 10 = 54.
		

Crossrefs

Programs

Formula

a(n) = (2*n^3 - n^2 - n)/2. - Vincenzo Librandi, Dec 12 2010; edited by Klaus Brockhaus, Dec 12 2010
From Chai Wah Wu, Aug 03 2022: (Start)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n > 3.
G.f.: x^2*(5 + x)/(1 - x)^4. (End)
E.g.f.: (x^2/2)*(5 + 2*x)*exp(x). - G. C. Greubel, Oct 14 2023

Extensions

Definition clarified and offset changed from 1 to 0 by Klaus Brockhaus, Dec 12 2010

A060985 a(1) = 1; a(n+1) = a(n) + (largest triangular number <= a(n)).

Original entry on oeis.org

1, 2, 3, 6, 12, 22, 43, 79, 157, 310, 610, 1205, 2381, 4727, 9383, 18699, 37227, 74355, 148660, 296900, 593735, 1187240, 2373810, 4746741, 9491481, 18981027, 37956907, 75910735, 151820416, 303627016, 607253419, 1214497244, 2428978214, 4857918665
Offset: 1

Views

Author

R. K. Guy, May 11 2001

Keywords

Comments

Arises in analyzing 'put-or-take' games (see Winning Ways, 484-486, 501-503), the prototype being Epstein's Put-or-Take-a-Square game.

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982.

Crossrefs

Programs

  • Haskell
    a060985 n = a060985_list !! (n-1)
    a060985_list = iterate a061885 1  -- Reinhard Zumkeller, Feb 03 2012
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[ {k = 1}, While[ k*(k + 1)/2 <= a[n - 1], k++ ]; a[n - 1] + k*(k - 1)/2]; Table[ a[n], {n, 1, 40} ]
    f[n_]:=Module[{c=Floor[(Sqrt[1+8n]-1)/2]},(c(c+1))/2]; NestList[#+f[#]&, 1, 40] (* Harvey P. Dale, Jun 19 2011 *)
  • PARI
    { default(realprecision, 1000); for (n=1, 1000, if (n<2, a=1, k=(sqrt(1 + 8*a) - 1)\2; a+=k*(k + 1)/2 ); write("b060985.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 16 2009
    

Formula

a(n+1) = a(n) + A061883(n) = a(n) + A057944(a(n)) = A061885(a(n)). - Henry Bottomley, May 12 2001
a(n) ~ 0.28276... * 2^n. - Charles R Greathouse IV, Jun 19 2011

Extensions

More terms from David W. Wilson, Henry Bottomley and Robert G. Wilson v, May 12 2001

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

A118175 Binary representation of n-th iteration of the Rule 220 elementary cellular automaton starting with a single black cell.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Apr 13 2006

Keywords

Comments

From Franklin T. Adams-Watters, Jul 05 2009: (Start)
Divided into rows of length 2n, row n consists of n 1's followed by n 0's.
Characteristic function of A061885, 1-based characteristic function of A004201. (End)
From Wolfdieter Lang, Dec 05 2012: (Start)
The row lengths sequence is A005408 (the odd numbers). The sum of row No. n is given by A000027(n+1).
This table is the first difference table of the q-binomial (Gauss polynomial) coefficient table G(2;n,k) = [q^k]( [n+2,2]_q) (see table A008967): a(n,k) = G(2;n,k) - G(2;n-1,k). The o.g.f. for the row polynomials is therefore G2(q,z) = (1-z)/Product((1-q^j*z),j=0..2) = 1/((1-q*z)*(1-q^2*z)). Therefore, a(n,k) determines the number of partitions of k into precisely n parts, each <= 2. It determines also the number of partitions of k into at most 2 parts, each <= n but not <= (n-1), i.e., with part n present. See comments on A008967 regarding partitions.
From the o.g.f. G2(q,z) it should be clear that there are 0's for n > k and only 1's for k = n,...,2*n.
(End)
This sequence is also generated by Rule 252. - Robert Price, Jan 31 2016
a(n) is 1 if the nearest square to n is >= n, otherwise 0. - Branko Curgus, Apr 25 2017

Examples

			The table a(n,k) begins:
  n\k 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 ...
  0:  1
  1:  0  1  1
  2:  0  0  1  1  1
  3:  0  0  0  1  1  1  1
  4:  0  0  0  0  1  1  1  1  1
  5:  0  0  0  0  0  1  1  1  1  1  1
  6:  0  0  0  0  0  0  1  1  1  1  1  1  1
  7:  0  0  0  0  0  0  0  1  1  1  1  1  1  1  1
  8:  0  0  0  0  0  0  0  0  1  1  1  1  1  1  1  1  1
  9:  0  0  0  0  0  0  0  0  0  1  1  1  1  1  1  1  1  1  1
... Reformatted and extended by _Wolfdieter Lang_, Dec 05 2012
Partition examples: a(n,k) = 0 if n>k because the maximal number of parts of a partition of k is k. a(n,n) = 1, n >= 1, because only the partition 1^n has n parts, and 1 <= 2.
  a(2,3) = 1 because the only partition of 3 with 2 parts, each <= 2, is 1,2. Also, the only partition of 3 with at most 2 parts, each <= 2, and a part 2 present is also 1,2.
  a(5,7) =1 because the only 5-part partition of 7 with maximal part 2 is 1^3,2^3. Also, the only partition of 7 with at most 2 parts, each <= 5, which a part 5 present is 2,5.
		

Crossrefs

Programs

  • Mathematica
    Table[1 - Ceiling[Sqrt[n]] + Round[Sqrt[n]], {n, 1, 257}] (* Branko Curgus, Apr 26 2017 *)
    Table[{Array[1&,n],Array[0&,n]},{n,1,5}]//Flatten (* Wolfgang Hintze, Jul 28 2017 *)
  • Python
    from math import isqrt
    def A118175(n): return 1+int(n-(m:=isqrt(n+1))*(m+1)>=0)-int(m**2!=n+1) # Chai Wah Wu, Jul 30 2022

Formula

a(n) = 1 - A079813(n+1). - Philippe Deléham, Jan 02 2012
a(n) = 1 - ceiling(sqrt(n+1)) + round(sqrt(n+1)). - Branko Curgus, Apr 27 2017 [Corrected by Ridouane Oudra, Dec 01 2019]
G.f.: x/(1 - x)*( Sum_{n >= 1} x^(n^2-n)*(1-x^n)) = 1/(2-2*x)* ( x + x^(3/4)*EllipticTheta(2,0,x) - x*EllipticTheta(3,0,x) ). - Wolfgang Hintze, Jul 28 2017
a(n) = floor(sqrt(n+1)+1/2) - floor(sqrt(n)) = round(sqrt(n+1)) - floor(sqrt(n)). - Ridouane Oudra, Dec 01 2019

A061887 n + largest square less than or equal to n; numbers in the range [2k^2,2k^2+2k] for some k.

Original entry on oeis.org

0, 2, 3, 4, 8, 9, 10, 11, 12, 18, 19, 20, 21, 22, 23, 24, 32, 33, 34, 35, 36, 37, 38, 39, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 128, 129
Offset: 0

Views

Author

Henry Bottomley, May 12 2001

Keywords

Examples

			a(15)=15+9=24; a(16)=16+16=32; a(17)=17+16=33.
		

Crossrefs

Programs

  • Mathematica
    Table[n+Floor[Sqrt[n]]^2,{n,0,70}] (* Harvey P. Dale, Aug 23 2012 *)

Formula

a(n) = n+[sqrt(n)]^2 = n+A048760(n) = 2n-A053186(n).
Showing 1-7 of 7 results.