Code Monkey home page Code Monkey logo

mian-chowla-sequence's Introduction

Mian-Chowla Sequence

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:

https://oeis.org/A005282

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.

Goals:

  1. 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}).)

  2. Keeping up my C++ experience and learning new concepts from C++11, C++14, and C++17.

  3. Comparing performance in C++ vs. functional Scala.

Setting up the project:

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

References

  1. Frank Chu. Notes on the Mian-Chowla Sequence.

http://alirejali.ir/afiles/up/other/paper43/NOTES%20ON%20THE%20MIAN-CHOWLA%20SEQUENCE%20A%20B%20sequence%20A%20=%20%7Ba%20%7D%20is%20an%20....pdf

  1. 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

  1. Raffaele Salvia. A New Lower Bound for the Distinct Distance Constant.

https://arxiv.org/pdf/1412.7157.pdf

mian-chowla-sequence's People

Contributors

sraaphorst avatar

Watchers

James Cloos avatar  avatar paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.