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

A000034 Period 2: repeat [1, 2]; a(n) = 1 + (n mod 2).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also continued fraction for (sqrt(3)+1)/2 (cf. A040001) and base-3 digital root of n+1 (cf. A007089, A010888). - Henry Bottomley, Jul 05 2001
The sequence 1,-2,-1,2,1,-2,-1,2,... with g.f. (1-2x)/(1+x^2) has a(n) = cos(Pi*n/2)-2*sin(Pi*n/2). - Paul Barry, Oct 18 2004
Hankel transform is [1,-3,0,0,0,0,0,0,0,...]. - Philippe Deléham, Mar 29 2007
4/33 = 0.121212... - Eric Desbiaux, Nov 03 2008
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=A[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1) = charpoly(A,2). - Milan Janjic, Jan 24 2010
First differences of A032766. - Tom Edgar, Jul 17 2014
Denominator of the harmonic mean of the first n triangular numbers. - Colin Barker, Nov 13 2014
This is the lexicographically earliest sequence of positive integers such that no polynomial of degree d can be fitted to d+2 consecutive terms (equivalently, such that no iterated difference is zero). - Pontus von Brömssen, Dec 26 2021 [See A300002 for the case where not only consecutive terms are considered. - Pontus von Brömssen, Jan 03 2023]
Number of maximum antichains in the power set of {1,2,...,n} partially ordered by set inclusion. For even n, there is a unique maximum antichain formed by all subsets of size n/2; for odd n, there are two maximum antichains, one formed by all subsets of size (n-1)/2 and the other formed by all subsets of size (n+1)/2. See the David Guichard link below for a proof. - Jianing Song, Jun 19 2022

References

  • Jozsef Beck, Combinatorial Games, Cambridge University Press, 2008.
  • J.-M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 545 pages 73 and 260, Ellipses, Paris 2004.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. sequences listed in Comments section of A283393.

Programs

Formula

G.f.: (1+2*x)/(1-x^2).
a(n) = 2^((1-(-1)^n)/2) = 2^(ceiling(n/2) - floor(n/2)). - Paul Barry, Jun 03 2003
a(n) = (3-(-1)^n)/2; a(n) = 1 + (n mod 2) = 3-a(n-1) = a(n-2) = a(-n).
a(n) = gcd(n-1, n+1). - Paul Barry, Sep 16 2004
Binomial transform of A123344, inverse binomial transform of A003945. - Philippe Deléham, Jun 04 2007
a(n) = A134451(n+1). - Reinhard Zumkeller, Oct 27 2007
a(n) = if(n=0,1,if(mod(a(n-1),2)=0,a(n-1)/2,(3*a(n-1)+1)/2)). See Collatz conjecture. - Paul Barry, Mar 31 2008
a(n) = 2^n (mod 3). - Vincenzo Librandi, Feb 05 2011
a(n) = A000035(n) + 1. - M. F. Hasler, Jan 13 2012
a(n) = abs(sin(n*Pi/2) - 2*cos(n*Pi/2)). - Mohammad K. Azarian, Mar 12 2012
a(n) = A010704(n) / 3. - Reinhard Zumkeller, Jul 03 2012
a(n) = floor((4/33)*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 03 2013
a(n) = floor((5/8)*3^(n+1)) mod 3. - Hieronymus Fischer, Jan 03 2013
a(n) = floor((n+1)*3/2) - floor((n)*3/2). - Hailey R. Olafson, Jul 23 2014
a(n) = denominator(n/2). - Wesley Ivan Hurt, Sep 11 2014
Dirichlet g.f.: zeta(s)*(1 + 1/2^s). - Mats Granvik, Jul 18 2016
E.g.f.: 2*sinh(x) + cosh(x). - Ilya Gutkovskiy, Jul 18 2016
a(n) = A010693(n) - 1. - Filip Zaludek, Oct 29 2016
a(n) = n + 1 - 2*floor(n/2). - Lorenzo Sauras Altuzarra, Jun 28 2019
Limit_{n->oo} (1/n)*Sum_{k=1..n} a(k) = 3/2 (De Koninck reference). - Bernard Schott, Nov 09 2021

Extensions

Better definition from M. F. Hasler, Jan 13 2012

A236335 Lexicographically earliest sequence of positive integers whose graph has no three collinear points.

Original entry on oeis.org

1, 1, 2, 2, 5, 4, 9, 3, 3, 6, 8, 5, 6, 9, 17, 4, 8, 15, 13, 24, 17, 13, 26, 32, 14, 7, 12, 29, 12, 18, 10, 10, 23, 35, 7, 16, 14, 30, 24, 23, 30, 46, 27, 20, 52, 15, 25, 40, 29, 40, 19, 38, 58, 18, 39, 42, 16, 69, 33, 25, 67, 43, 11, 51, 28, 11, 54, 73, 26, 27
Offset: 1

Views

Author

Tanya Khovanova, Jan 22 2014

Keywords

Comments

An integer can't appear more than twice in the sequence, which means the sequence tends to infinity.
An increasing version of this sequence is A236336.

Examples

			Consider a(5). The previous terms are 1,1,2,2. The value of a(5) can't be 1 because points (1,1),(2,1),(5,1) (corresponding to values a(1), a(2), a(5)) are on the same line: y=1. Points (3,2),(4,2),(5,2) are on the same line y=2, so a(5) can't be 2. Points (1,1),(3,2),(5,3) are on the same line: y=x/2+1/2, so a(5) can't be 3. Points (2,1),(3,2),(5,4) are on the same line: y=x-1, so a(5) can't be 4. Thus a(5)=5.
		

Crossrefs

Programs

  • Mathematica
    b[1] = 1;
    b[n_] := b[n] =
      Min[Complement[Range[100],
        Select[Flatten[
          Table[b[k] + (n - k) (b[j] - b[k])/(j - k), {k, n - 2}, {j,
            k + 1, n - 1}]], IntegerQ[#] &]]]
    Table[b[k], {k, 70}]

Formula

a(n) = A236266(n-1) + 1. - Alois P. Heinz, Jan 23 2014

A231334 Lexicographically earliest sequence of distinct positive integers such that for any distinct i,j, k, the points at positions (i, a(i)), (j, a(j)), (k, a(k)) are not aligned.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 9, 12, 7, 14, 13, 8, 23, 17, 18, 22, 10, 15, 11, 28, 19, 16, 20, 29, 32, 44, 35, 39, 24, 40, 26, 37, 42, 21, 56, 64, 43, 31, 25, 34, 27, 33, 66, 67, 52, 60, 30, 57, 36, 63, 86, 82, 38, 50, 47, 69, 75, 79, 89, 49, 45, 76, 41, 48, 98, 77, 94
Offset: 1

Views

Author

Paul Tek, Nov 07 2013

Keywords

Comments

Is this a permutation of the natural numbers?
There are only two fixed points: 1 and 2.

Crossrefs

Programs

  • C
    See Link section.
  • Mathematica
    WIDTH = 1000;
    HEIGHT = 2000;
    Clear[seen, aligned, a];
    compute[n_] := Module[{c = 1}, While[seen[c] || aligned[n][c], c++; If[c > HEIGHT, Abort[]]]; a[n] = c; seen[a[n]] = True; For[i = 1, i < n, i++, dn = n - i; da = a[n] - a[i]; g = GCD[dn, da]; dn /= g; da /= g; nn = n; na = c; While[True, nn += dn; If[nn > WIDTH, Break[]]; na += da; If[na < 1 || na > HEIGHT, Break[]]; aligned[nn][na] = True]]; a[n]];
    Array[compute, WIDTH] (* Jean-François Alcover, Apr 19 2020, translated from Paul Tek's program. *)

A301802 Number of permutations of {1, 2, ..., n} such that no k+2 points lie on a polynomial of degree k.

Original entry on oeis.org

1, 1, 2, 4, 18, 48, 216, 584, 2870, 10408, 45244, 160248, 762554
Offset: 0

Views

Author

Peter Kagey, Mar 26 2018

Keywords

Comments

a(n) is even for all n > 1.
Is this sequence strictly increasing for n > 0?

Examples

			For n = 4, the 18 different permutations are:
[1,2,4,3],[1,3,2,4],[1,3,4,2],[1,4,2,3],[2,1,3,4],[2,1,4,3],
[2,3,1,4],[2,4,1,3],[2,4,3,1],[3,1,2,4],[3,1,4,2],[3,2,4,1],
[3,4,1,2],[3,4,2,1],[4,1,3,2],[4,2,1,3],[4,2,3,1],[4,3,1,2].
		

Crossrefs

Cf. A300002.

Extensions

a(0) and a(10)-a(12) from Peter J. Taylor, Mar 28 2018

A300670 Table read by antidiagonals: the n-th row is the lexicographically earliest sequence such that no k + 2 points of ((1, a(1)), (2, a(2)), ...) lie on a polynomial of degree k for k < n.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 4, 2, 1, 5, 3, 4, 2, 1, 6, 6, 3, 4, 2, 1, 7, 5, 6, 3, 4, 2, 1, 8, 9, 5, 6, 3, 4, 2, 1, 9, 12, 9, 5, 6, 3, 4, 2, 1, 10, 7, 12, 9, 5, 6, 3, 4, 2, 1, 11, 14, 19, 12, 9, 5, 6, 3, 4, 2, 1, 12, 13, 17, 19, 16, 9, 5, 6, 3, 4, 2, 1, 13, 8, 7, 17
Offset: 1

Views

Author

Peter Kagey, Mar 11 2018

Keywords

Comments

Is every row a permutation of the natural numbers?
The first row is the positive integers, the second row is A231334, and the main diagonal is A300002.
T(n, m) = A300002(m) for n >= m, thus the rows converge to A300002 in the limit.

Examples

			Table begins
1, 2, 3, 4, 5, 6, 7,  8,  9, 10, 11, 12, 13, 14, 15, 16, ...
1, 2, 4, 3, 6, 5, 9, 12,  7, 14, 13,  8, 23, 17, 18, 22, ...
1, 2, 4, 3, 6, 5, 9, 12, 19, 17,  7,  8, 15, 20, 18, 22, ...
1, 2, 4, 3, 6, 5, 9, 12, 19, 17,  8, 10, 31,  7, 11, 22, ...
1, 2, 4, 3, 6, 5, 9, 16, 14, 20,  7, 15,  8, 12, 18, 31, ...
1, 2, 4, 3, 6, 5, 9, 16, 14, 20,  7, 15,  8, 12, 18, 31, ...
...
In the first row, no two points lie on a 0-degree polynomial (i.e., all terms are distinct).
In the second row, no two terms are the same and no three points (1, a(1)), (2, a(2)), ... lie on the same line.
In the third row, no two terms are the same; no three points (1, a(1)), (2, a(2)), ... lie on the same line; and no four points lie on the same parabola.
		

Crossrefs

Showing 1-5 of 5 results.