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.

A033638 Quarter-squares plus 1 (that is, a(n) = A002620(n) + 1).

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 10, 13, 17, 21, 26, 31, 37, 43, 50, 57, 65, 73, 82, 91, 101, 111, 122, 133, 145, 157, 170, 183, 197, 211, 226, 241, 257, 273, 290, 307, 325, 343, 362, 381, 401, 421, 442, 463, 485, 507, 530, 553, 577, 601, 626, 651, 677, 703, 730, 757, 785, 813, 842
Offset: 0

Views

Author

Tanya Y. Berger-Wolf (tanyabw(AT)uiuc.edu)

Keywords

Comments

Fill an infinity X infinity matrix with numbers so that 1..n^2 appear in the top left n X n corner for all n; write down the minimal elements in the rows and columns and sort into increasing order; maximize this list in the lexicographic order.
From Donald S. McDonald, Jan 09 2003: (Start)
Numbers of the form n^2 + 1 or n^2 + n + 1.
Locations of right angle turns in Ulam square spiral. (End)
a(n-1) (for n >= 1) is also the number u of unique Fibonacci/Lucas type sequences generated (the total number t of these sequences being a triangular number). Sum(n+1)=t. Then u=Sum((n+1/2) minus 0.5 for odd terms) except for the initial term. E.g., u=13: (n=6)+1 = 7; then 7/2 - 0.5 =3. So u = Sum(1, 1, 1, 2, 2, 3, 3) = 13. - Marco Matosic, Mar 11 2003
Number of (3412,123)-avoiding involutions in S_n.
Schur's Theorem (1905): the maximum number of mutually commuting linearly independent complex matrices of order n is floor((n^2)/4) + 1. - Jonathan Vos Post, Apr 03 2007
Let A be the Hessenberg n X n matrix defined by: A[1,j]=j mod 2, A[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n >= 1, a(n)=(-1)^(n-1)*coeff(charpoly(A,x),x). - Milan Janjic, Jan 24 2010
Except for the initial two terms, A033638 gives iterates of the nonsquare function: c(n) = f(c(n-1)), where f(n) = A000037(n) = n + floor(1/2 + sqrt(n)) = n-th nonsquare, starting with c(1)=2. - Clark Kimberling, Dec 28 2010
For n >= 1: for all permutations of [0..n-1]: number of distinct values taken by Sum_{k=0..n-1} (k mod 2) * pi(k). - Joerg Arndt, Apr 22 2011
First differences are A110654. - Jon Perry, Sep 12 2012
Number of (weakly) unimodal compositions of n with maximal part <= 2, see example. - Joerg Arndt, May 10 2013
Construct an infinite triangular matrix with 1's in the leftmost column and the natural numbers in all other columns but shifted down twice. Square the triangle and the sequence is the leftmost column vector. - Gary W. Adamson, Jan 27 2014
Equals the sum of terms in upward sloping diagonals of an infinite lower triangle with 1's in the leftmost column and the natural numbers in all other columns. - Gary W. Adamson, Jan 29 2014
a(n) is the number of permutations of length n avoiding both 213 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - Manda Riehl, Aug 05 2014
Number of partitions of n with no more than 2 parts > 1. - Wouter Meeussen, Feb 22 2015, revised Apr 24 2023
Number of possible values for the area of a polyomino whose perimeter is 2n + 4. - Luc Rousseau, May 10 2018
a(n) is the number of 231-avoiding even Grassmannian permutations of size n+1. - Juan B. Gil, Mar 10 2023
For n > 0, a(n) is the smallest number that requires n iterations of the map k -> k - floor(sqrt(k)) to reach 0. - Jon E. Schoenfield, Jun 24 2023
a(n) agrees with the lower matching number of the (n + 1) X (n + 1) black bishop graph from n = 1 up to at least n = 14. - Eric W. Weisstein, Dec 23 2024
For n > 0, obtain a positive integer a(n+1) recursively from a(n) by minimizing a(n+1) > a(n) so that each gap between a(k) and a(k+1) for 1 <= k <= n is used at most twice. - Gerold Jäger, Jun 04 2025
From Roger Ford, May 19 2025: (Start)
a(n) = the number of different total arch lengths for the top arches of semi-meanders with n+2 arches.
Example: Each arch length equals 1 + the number of covered arches.
For semi-meanders with 5 top arches there are 3 different values.
/\
//\\ /\ /\
///\\\ //\\ /\ / \
////\\\\ /\ ///\\\ //\\ //\/\\ /\ /\
Total arch lengths: 4+3+2+1 +1= 11 3+2+1 2+1= 9 3+1+1 +1 +1= 7, so a(3) = 3.
For semi-meanders with 6 top arches there are 5 values: 8, 10, 12, 14, 16, so a(4) = 5. (End)

Examples

			First 4 rows can be taken to be 1,2,5,10,17,...; 3,4,6,11,18,...; 7,8,9,12,19,...; 13,14,15,16,20,...
Ulam square spiral = 7 8 9 / 6 1 2 / 5 4 3 /...; changes of direction (right-angle) at 1 2 3 5 7 ...
From _Joerg Arndt_, May 10 2013: (Start)
The a(7)=13 unimodal compositions of 7 with maximal part <= 2 are
  01:  [ 1 1 1 1 1 1 1 ]
  02:  [ 1 1 1 1 1 2 ]
  03:  [ 1 1 1 1 2 1 ]
  04:  [ 1 1 1 2 1 1 ]
  05:  [ 1 1 1 2 2 ]
  06:  [ 1 1 2 1 1 1 ]
  07:  [ 1 1 2 2 1 ]
  08:  [ 1 2 1 1 1 1 ]
  09:  [ 1 2 2 1 1 ]
  10:  [ 1 2 2 2 ]
  11:  [ 2 1 1 1 1 1 ]
  12:  [ 2 2 1 1 1 ]
  13:  [ 2 2 2 1 ]
(End)
G.f. = 1 + x + 2*x^2 + 3*x^3 + 5*x^4 + 7*x^5 + 10*x^6 + 13*x^7 + 17*x^8 + ...
		

Crossrefs

Equals A002620 + 1.
Cf. A002878, A004652, A002984, A083479, A080037 (complement, except 2).
A002522 lists the even-indexed terms of this sequence.

Programs

  • Haskell
    a033638 = (+ 1) . (`div` 4) . (^ 2)  -- Reinhard Zumkeller, Apr 06 2012
    
  • Magma
    [n^2 div 4 + 1: n in [0.. 50]]; // Vincenzo Librandi, Jul 31 2016
    
  • Maple
    with(combstruct):ZL:=[st,{st=Prod(left,right),left=Set(U,card=r),right=Set(U,card=3)}, unlabeled]: subs(r=1,stack): seq(count(subs(r=2,ZL),size=m),m=6..62); # Zerinvary Lajos, Mar 09 2007
    A033638 := proc(n)
            1+floor(n^2/4) ;
    end proc: # R. J. Mathar, Jul 13 2012
  • Mathematica
    a[n_] := a[n] = 2*a[n - 1] - 2*a[n - 3] + a[n - 4]; a[0] = a[1] = 1; a[2] = 2; a[3] = 3; Array[a, 54, 0] (* Robert G. Wilson v, Mar 28 2011 *)
    LinearRecurrence[{2, 0, -2, 1}, {1, 1, 2, 3}, 60] (* Robert G. Wilson v, Sep 16 2012 *)
  • PARI
    {a(n) = n^2\4 + 1} /* Michael Somos, Apr 03 2007 */
    
  • Python
    def A033638(n): return (n**2>>2)+1 # Chai Wah Wu, Jul 27 2022

Formula

a(n) = ceiling((n^2+3)/4) = ( (7 + (-1)^n)/2 + n^2 )/4.
a(n) = A001055(prime^n), number of factorizations. - Reinhard Zumkeller, Dec 29 2001
G.f.: (1-x+x^3)/((1-x)^2*(1-x^2)); a(n) = a(n-1) + a(n-2) - a(n-3) + 1. - Jon Perry, Jul 07 2004
a(n) = a(n-2) + n - 1. - Paul Barry, Jul 14 2004
a(0) = 1; a(1) = 1; for n > 1 a(n) = a(n-1) + round(sqrt(a(n-1))). - Jonathan Vos Post, Jan 19 2006
a(n) = floor((n^2)/4) + 1.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3. - Philippe Deléham, Nov 03 2008
a(0) = a(1) = 1, a(n) = a(n-1) + ceiling(sqrt(a(n-2))) for n > 1. - Jonathan Vos Post, Oct 08 2011
a(n) = floor(b(n)) with b(n) = b(n-1) + n/(1+e^(1/n)) and b(0)= 1. - Richard R. Forberg, Jun 08 2013
a(n) = a(n-1) + floor(n/2). - Michel Lagneau, Jul 11 2014
From Ilya Gutkovskiy, Oct 07 2016: (Start)
E.g.f.: (exp(-x) + (7 + 2*x + 2*x^2)*exp(x))/8.
a(n) = Sum_{k=0..n} A123108(k).
Convolution of A008619 and A179184. (End)
a(n) = (n^2 - n + 4)/2 - a(n-1) for n >= 1. - Kritsada Moomuang, Aug 03 2019