In mathematics, the boustrophedon transform is a procedure which maps one sequence to another. The transformed sequence is computed by an "addition" operation, implemented as if filling a triangular array in a boustrophedon (zigzag- or serpentine-like) manner—as opposed to a "Raster Scan" sawtooth-like manner.
 The boustrophedon transform is a numerical, sequence-generating transformation, which is determined by an "addition" operation.
 Generally speaking, given a sequence: 
  
    
      
        (
        
          a
          
            0
          
        
        ,
        
          a
          
            1
          
        
        ,
        
          a
          
            2
          
        
        ,
        …
        )
      
    
    {\displaystyle (a_{0},a_{1},a_{2},\ldots )}
  
, the boustrophedon transform yields another sequence: 
  
    
      
        (
        
          b
          
            0
          
        
        ,
        
          b
          
            1
          
        
        ,
        
          b
          
            2
          
        
        ,
        …
        )
      
    
    {\displaystyle (b_{0},b_{1},b_{2},\ldots )}
  
, where 
  
    
      
        
          b
          
            0
          
        
      
    
    {\displaystyle b_{0}}
  
 is likely defined equivalent to 
  
    
      
        
          a
          
            0
          
        
      
    
    {\displaystyle a_{0}}
  
. The entirety of the transformation itself can be visualized (or imagined) as being constructed by filling-out the triangle as shown in Figure 1.
 To fill-out the numerical Isosceles triangle (Figure 1), you start with the input sequence, 
  
    
      
        (
        
          a
          
            0
          
        
        ,
        
          a
          
            1
          
        
        ,
        
          a
          
            2
          
        
        ,
        …
        )
      
    
    {\displaystyle (a_{0},a_{1},a_{2},\ldots )}
  
, and place one value (from the input sequence) per row, using the boustrophedon scan (zigzag- or serpentine-like) approach.
 The top vertex of the triangle will be the input value 
  
    
      
        
          a
          
            0
          
        
      
    
    {\displaystyle a_{0}}
  
, equivalent to output value 
  
    
      
        
          b
          
            0
          
        
      
    
    {\displaystyle b_{0}}
  
, and we number this top row as row 0.
 The subsequent rows (going down to the base of the triangle) are numbered consecutively (from 0) as integers—let 
  
    
      
        k
      
    
    {\displaystyle k}
  
 denote the number of the row currently being filled. These rows are constructed according to the row number (
  
    
      
        k
      
    
    {\displaystyle k}
  
) as follows:
 Refer to the arrows in Figure 1 for a visual representation of these "addition" operations.
 For a given, finite input-sequence: 
  
    
      
        (
        
          a
          
            0
          
        
        ,
        
          a
          
            1
          
        
        ,
        .
        .
        .
        
          a
          
            N
          
        
        )
      
    
    {\displaystyle (a_{0},a_{1},...a_{N})}
  
, of 
  
    
      
        N
      
    
    {\displaystyle N}
  
 values, there will be exactly 
  
    
      
        N
      
    
    {\displaystyle N}
  
 rows in the triangle, such that 
  
    
      
        k
      
    
    {\displaystyle k}
  
 is an integer in the range: 
  
    
      
        [
        0
        ,
        N
        )
      
    
    {\displaystyle [0,N)}
  
 (exclusive). In other words, the last row is 
  
    
      
        k
        =
        N
        −
        1
      
    
    {\displaystyle k=N-1}
  
.
 A more formal definition uses a recurrence relation. Define the numbers 
  
    
      
        
          T
          
            k
            ,
            n
          
        
      
    
    {\displaystyle T_{k,n}}
  
 (with k ≥ n ≥ 0) by
 Then the transformed sequence is defined by 
  
    
      
        
          b
          
            n
          
        
        =
        
          T
          
            n
            ,
            n
          
        
      
    
    {\displaystyle b_{n}=T_{n,n}}
  
 (for 
  
    
      
        
          T
          
            2
            ,
            2
          
        
      
    
    {\displaystyle T_{2,2}}
  
 and greater indices).
 Per this definition, note the following definitions for values outside the restrictions (from the relationship above) on 
  
    
      
        (
        k
        ,
        n
        )
      
    
    {\displaystyle (k,n)}
  
 pairs:
 
  
    
      
        
          
            
              
                
                  T
                  
                    0
                    ,
                    0
                  
                
                
                
                  
                    =
                    Δ
                  
                
              
              
                
                
                  a
                  
                    0
                  
                
                
                
                  
                    =
                    Δ
                  
                
                
                
                  b
                  
                    0
                  
                
              
            
            
              
            
            
              
                
                  T
                  
                    k
                    ,
                    0
                  
                
                
                
                  
                    =
                    Δ
                  
                
              
              
                
                
                  a
                  
                    k
                  
                
                
                
                ⟺
                
                k
                
                
                  is even
                
              
            
            
              
                
                  T
                  
                    k
                    ,
                    0
                  
                
                
                
                  
                    =
                    Δ
                  
                
              
              
                
                
                  b
                  
                    k
                  
                
                
                
                ⟺
                
                k
                
                
                  is odd
                
              
            
            
              
            
            
              
                
                  T
                  
                    0
                    ,
                    k
                  
                
                
                
                  
                    =
                    Δ
                  
                
              
              
                
                
                  b
                  
                    k
                  
                
                
                
                ⟺
                
                k
                
                
                  is even
                
              
            
            
              
                
                  T
                  
                    0
                    ,
                    k
                  
                
                
                
                  
                    =
                    Δ
                  
                
              
              
                
                
                  a
                  
                    k
                  
                
                
                
                ⟺
                
                k
                
                
                  is odd
                
              
            
          
        
      
    
    {\displaystyle {\begin{aligned}T_{0,0}\,{\overset {\Delta }{=}}&\,a_{0}\,{\overset {\Delta }{=}}\,b_{0}\\\\T_{k,0}\,{\overset {\Delta }{=}}&\,a_{k}\,\iff k\,{\text{is even}}\\T_{k,0}\,{\overset {\Delta }{=}}&\,b_{k}\,\iff k\,{\text{is odd}}\\\\T_{0,k}\,{\overset {\Delta }{=}}&\,b_{k}\,\iff k\,{\text{is even}}\\T_{0,k}\,{\overset {\Delta }{=}}&\,a_{k}\,\iff k\,{\text{is odd}}\\\end{aligned}}}
  

 In the case a0 = 1, an = 0 (n > 0), the resulting triangle is called the Seidel–Entringer–Arnold Triangle and the numbers 
  
    
      
        
          T
          
            k
            ,
            n
          
        
      
    
    {\displaystyle T_{k,n}}
  
 are called Entringer numbers (sequence A008281 in the OEIS).
 In this case the numbers in the transformed sequence bn are called the Euler up/down numbers. This is sequence A000111 on the On-Line Encyclopedia of Integer Sequences. These enumerate the number of alternating permutations on n letters and are related to the Euler numbers and the Bernoulli numbers.
 Building from the geometric design of the boustrophedon transform, algebraic definitions of the relationship from input values (
  
    
      
        
          a
          
            i
          
        
      
    
    {\displaystyle a_{i}}
  
) to output values (
  
    
      
        
          b
          
            i
          
        
      
    
    {\displaystyle b_{i}}
  
) can be defined for different algebras ("numeric domains").
 In the Euclidean (
  
    
      
        
          
            E
          
          
            n
          
        
      
    
    {\displaystyle \mathbb {E} ^{n}}
  
) Algebra for Real (
  
    
      
        
          
            R
          
          
            1
          
        
      
    
    {\displaystyle \mathbb {R} ^{1}}
  
)-valued scalars, the boustrophedon transformed Real-value (bn) is related to the input value, (an), as:
 
  
    
      
        
          
            
              
                
                  b
                  
                    n
                  
                
              
              
                
                =
                
                  ∑
                  
                    k
                    =
                    0
                  
                  
                    n
                  
                
                
                  
                    
                      (
                    
                    
                      n
                      k
                    
                    
                      )
                    
                  
                
                
                  a
                  
                    k
                  
                
                
                  E
                  
                    n
                    −
                    k
                  
                
              
            
          
        
      
    
    {\displaystyle {\begin{aligned}b_{n}&=\sum _{k=0}^{n}{\binom {n}{k}}a_{k}E_{n-k}\\\end{aligned}}}
  
,
 with the reverse relationship (input from output) defined as:
 
  
    
      
        
          
            
              
                
                  a
                  
                    n
                  
                
              
              
                
                =
                
                  ∑
                  
                    k
                    =
                    0
                  
                  
                    n
                  
                
                (
                −
                1
                
                  )
                  
                    n
                    −
                    k
                  
                
                
                  
                    
                      (
                    
                    
                      n
                      k
                    
                    
                      )
                    
                  
                
                
                  b
                  
                    k
                  
                
                
                  E
                  
                    n
                    −
                    k
                  
                
              
            
          
        
      
    
    {\displaystyle {\begin{aligned}a_{n}&=\sum _{k=0}^{n}(-1)^{n-k}{\binom {n}{k}}b_{k}E_{n-k}\end{aligned}}}
  
,
 where (En) is the sequence of "up/down" numbers—also known as secant or tangent numbers.
 The exponential generating function of a sequence (an) is defined by
 The exponential generating function of the boustrophedon transform (bn) is related to that of the original sequence (an) by
 The exponential generating function of the unit sequence is 1, so that of the up/down numbers is sec x + tan x.