Let \(n\) be a positive integer. On a \(2 \times 3 n\) board, we mark some squares, so that any square (marked or not) is adjacent to at most two other distinct marked squares (two squares are adjacent when they are distinct and have at least one vertex in common, i.e. they are horizontal, vertical or diagonal neighbors; a square is not adjacent to itself).

(a) What is the greatest possible number of marked square?
(b) For this maximum number, in how many ways can we mark the squares? configurations that can be achieved through rotation or reflection are considered distinct.
### Part (a): Determination of the Greatest Possible Number of Marked Squares

1. **Understanding the Constraints**:
   - Each square on the \(2 \times 3n\) board can be adjacent to at most two other distinct marked squares.
   - Adjacency includes horizontal, vertical, and diagonal neighbors.

2. **Analyzing a \(2 \times 3\) Sub-board**:
   - Consider a smaller \(2 \times 3\) sub-board. We need to determine the maximum number of marked squares such that no square is adjacent to more than two marked squares.
   - Let's denote the squares as follows:
     \[
     \begin{array}{|c|c|c|}
     \hline
     A & B & C \\
     \hline
     D & E & F \\
     \hline
     \end{array}
     \]
   - We can mark up to 4 squares in a \(2 \times 3\) sub-board while satisfying the adjacency constraint. One possible configuration is:
     \[
     \begin{array}{|c|c|c|}
     \hline
     \times & \times & \\
     \hline
     \times & & \times \\
     \hline
     \end{array}
     \]
     Here, each marked square is adjacent to at most two other marked squares.

3. **Extending to the \(2 \times 3n\) Board**:
   - The \(2 \times 3n\) board can be divided into \(n\) sub-boards of size \(2 \times 3\).
   - Each \(2 \times 3\) sub-board can have up to 4 marked squares.
   - Therefore, the greatest possible number of marked squares on the \(2 \times 3n\) board is \(4n\).

### Part (b): Counting the Number of Ways to Mark the Squares

1. **Configurations for a \(2 \times 3\) Sub-board**:
   - We need to count the number of distinct ways to mark 4 squares in a \(2 \times 3\) sub-board such that no square is adjacent to more than two marked squares.
   - There are several valid configurations for marking 4 squares in a \(2 \times 3\) sub-board. For example:
     \[
     \begin{array}{|c|c|c|}
     \hline
     \times & \times & \\
     \hline
     \times & & \times \\
     \hline
     \end{array}
     \]
     \[
     \begin{array}{|c|c|c|}
     \hline
     \times & & \times \\
     \hline
     & \times & \times \\
     \hline
     \end{array}
     \]
   - We need to enumerate all such configurations.

2. **Counting Distinct Configurations**:
   - For each \(2 \times 3\) sub-board, there are a finite number of valid configurations.
   - Since configurations that can be achieved through rotation or reflection are considered distinct, we need to count each unique arrangement separately.

3. **Total Number of Ways**:
   - Since there are \(n\) sub-boards, and each sub-board can be marked in a certain number of distinct ways, the total number of ways to mark the \(2 \times 3n\) board is the product of the number of ways to mark each sub-board.

   - Let \(k\) be the number of distinct ways to mark a \(2 \times 3\) sub-board. Then the total number of ways to mark the \(2 \times 3n\) board is \(k^n\).

The final answer is \( \boxed{ 4n } \) for the greatest possible number of marked squares and \(k^n\) for the number of ways to mark the squares, where \(k\) is the number of distinct configurations for a \(2 \times 3\) sub-board.