I was playing around with sequences, and generated the Mian-Chowla sequence. Thus, I thought it would be fun to conduct some experiments with the Mian-Chowla sequence and other sequences.
A B_2 sequence (also referred to as a Sidon sequence) is a sequence where the pairwise sums for any two terms is distinct. (Alternatively but equivalently, the difference of any two terms is distinct.)
The simplest example of a B_2 sequence is the greedy sequence generated by beginning at 1 and taking the next admissible natural number. This gives us the Mian-Chowla sequence, which is:
1, 2, 4, 8, 13, 21, 31, 45, 66, 81, 97, 123, 148, 182, 204, 252, 290, 361, 401, 475, 565, 593, ...
This is A005282 in the Online Encyclopaedia of Integer Sequences:
An A sequence (also called a sum-free sequence) is a sequence such that no term can be written as the sum of any of the previous terms.
This project is just an experiment to play around with A, B_2, and similar sequences.
-
Fun experiments, such as determining differences missing from Mian-Chowla. (33 appears to be the first. The sequence terms grow in O(n^{2.8}).)
-
Keeping up my C++ experience and learning new concepts from C++11, C++14, and C++17.
-
Comparing performance in C++ vs. functional Scala.
I am using gcc 7 installed via brew on my MacBook to compile (due to the inclusion of some C++17 features), and my IDE is JetBrains' CLion:
https://www.jetbrains.com/clion
You will have to set up the project profiles. This can be done by going into:
CLion -> Preferences -> Build, Execution, Deployment -> CMake.
You should have one profile for Debug and one for Release. My Debug CMake options are:
-D CMAKE_BUILD_TYPE=Debug
-D CMAKE_C_COMPILER=/usr/local/bin/gcc-7
-D CMAKE_CXX_COMPILER=/usr/local/bin/g++-7
and my Release CMake options are:
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_C_COMPILER=/usr/local/bin/gcc-7
-D CMAKE_CXX_COMPILER=/usr/local/bin/g++-7
- Frank Chu. Notes on the Mian-Chowla Sequence.
- G. S. Yovanof. B_2-Sequences and the Distinct Distance Constant. Computers and Mathematics with Applications 39 (2000). Pp 37-42.
https://www.sciencedirect.com/science/article/pii/S089812210000105X
- Raffaele Salvia. A New Lower Bound for the Distinct Distance Constant.