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

A158799 a(0)=1, a(1)=2, a(n)=3 for n >= 2.

Original entry on oeis.org

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

Views

Author

Jaume Oliver Lafont, Mar 27 2009

Keywords

Comments

a(n) = number of neighboring natural numbers of n (i.e., n, n - 1, n + 1). a(n) = number of natural numbers m such that n - 1 <= m <= n + 1. Generalization: If a(n,k) = number of natural numbers m such that n - k <= m <= n + k (k >= 1) then a(n,k) = a(n-1,k) + 1 = n + k for 0 <= n <= k, a(n,k) = a(n-1,k) = 2*k + 1 for n >= k + 1. - Jaroslav Krizek, Nov 18 2009
Partial sums of A130716; partial sums give A008486. - Jaroslav Krizek, Dec 06 2009
In atomic spectroscopy, a(n) is the number of P term symbols with spin multiplicity equal to n+1, i.e., there is one singlet-P term (n=0), there are two doublet-P terms (n=1), and there are three P terms for triple multiplicity (n=2) and higher (n>2). - A. Timothy Royappa, Mar 16 2012
a(n+1) is also the domination number of the n-Andrásfai graph. - Eric W. Weisstein, Apr 09 2016
Decimal expansion of 37/300. - Elmo R. Oliveira, May 11 2024
a(n+1) is also the domination number of the n X n rook complement graph. - Eric W. Weisstein, Mar 10 2025

Crossrefs

Programs

  • Mathematica
    PadRight[{1,2},120,{3}] (* or *) Min[#,3]&/@Range[120] (* Harvey P. Dale, Apr 08 2018 *)
  • PARI
    a(n)=if(n>1,3,if(n<0,0,n++))

Formula

G.f.: (1+x+x^2)/(1-x) = (1-x^3)/(1-x)^2.
a(n) = (n>=0)+(n>=1)+(n>=2).
a(n) = 1 + n for 0 <= n <= 1, a(n) = 3 for n >= 2. a(n) = A157532(n) for n >= 1. - Jaroslav Krizek, Nov 18 2009
E.g.f.: 3*exp(x) - x - 2 = x^2/(2*G(0)) where G(k) = 1 + (k+2)/(x - x*(k+1)/(x + k + 1 - x^4/(x^3 + (k+1)*(k+2)*(k+3)/G(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Jul 06 2012
a(n) = min(n+1,3). - Wesley Ivan Hurt, Apr 16 2014
a(n) = 1 + A130130(n). - Elmo R. Oliveira, May 11 2024

Extensions

Corrected by Jaroslav Krizek, Dec 17 2009

A103947 a(n) is the number of distinct n-th powers of functions {1, 2} -> {1, 2}.

Original entry on oeis.org

1, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3
Offset: 0

Views

Author

David Wasserman, Feb 21 2005

Keywords

Examples

			a(4) = 3: the four functions {1, 2} -> {1, 2} are f(x) = 1, g(x) = 2, h(x) = x and j(x) = 3 - x. f^4(x) = f(f(f(f(x)))) = 1; so f^4 = f. Similarly, g^4 = g, h^4 = h and j^4 = h, so there are 3 distinct 4th powers.
		

Crossrefs

Programs

  • Mathematica
    Join[{1},LinearRecurrence[{0, 1},{4, 3},104]] (* Ray Chandler, Sep 08 2015 *)

Formula

For n > 2, a(n) = a(n-2).
G.f.: (1+4*x+2*x^2)/(1-x^2). - Jaume Oliver Lafont, Mar 20 2009
a(n) = (n mod 2)+(2 mod (n+2))+1. - Aaron J Grech, Sep 02 2024
E.g.f.: 3*cosh(x) + 4*sinh(x) - 2. - Stefano Spezia, Sep 04 2024
Showing 1-2 of 2 results.