1

I came across this concept when I had to figure out a way to alternate spacing in a program I was writing. I'm curious to know if there's a formal term for this concept.

Here's the description.

You have a divisor D [in this example it's 15] .

You have set A of contiguous natural numbers [say 1-100]

You have two subsets of A called B and C.

Each subset B and C contains the first number and each sequential number up until and including the divisor D, and then switches to the other subset until the divisor is equally divisible again. This repeats until the union B$\bigcup$C of both subsets contain the entire set.

To display visually:

A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}

B = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}

Is there a name for this kind of set alternation?

Thank you!

  • I don't know of any terminology for this partition. If it helps, note that $A$ consists of the numbers $n$ for which the ceiling of $\frac nd$ is odd, while $B$ consists of the numbers $n$ for which the ceiling of $\frac nd$ is even. (Here the ceiling of a real number $x$ is the smallest integer that's greater than or equal to $x$; so ceiling$(2)=2$, ceiling$(\pi)=4$, ceiling$(9.01)=10$.) – Greg Martin Nov 12 '16 at 19:08
  • Wow that is very cool! I appreciate your great eye! – Shmuel Kamensky Nov 12 '16 at 19:15

1 Answers1

1

Here's one way to solve the problem - it's another way to look at @GregMartin 's solution.

Start with the set $S = \{1, \ldots D\}$. Then $A$ contains the numbers you get by adding even multiples of $D$ to the elements of $S$; $B$ contains the sums with odd multiples.

This would be an easy standalone loop in your program, or the logic could be incorporated in another loop that dealt with the numbers.

To answer your question: I don't know of any particular name for this construction.

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199