All Tools
Categories
Number Tools 69 XML Tools 64 Email Marketing Tools 55 Import-Export Tools 50 JSON Tools 45 Text Tools 13 Shipping Freight Tools 5 Calculator 4
About Contact Privacy

Rudin-Shapiro Numbers Generator

Generate Rudin-Shapiro numbers: r(n) = +1 or -1 from the parity of adjacent "11" pairs in the binary form of n: 1, 1, 1, -1, 1, 1, -1, 1... The sequence whose partial sums stay surprisingly small. Runs in your browser. Free.

Parameters
1 - 10,000
r(n) = +1 when the binary form of n holds an even number of adjacent 11 pairs, -1 when odd. Overlap counts: "111" has two pairs.
Sequence

          

About Rudin-Shapiro Numbers Generator

Count the adjacent "11" pairs in the binary expansion of n, and take a parity vote: even gives +1, odd gives -1. The result is the Rudin-Shapiro sequence — 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, ... — a +1/-1 sequence built to defeat a folklore conjecture of Littlewood, and today a quiet workhorse of polyphase signal design.

Rudin-Shapiro Numbers Generator counts the overlapping 11-pairs exactly for any starting index, renders each value with its binary form and pair count, and tracks the running sum so the famously flat partial sums are visible immediately.

Features

  • Exact pair counting: Overlapping windows handled precisely, so "111" contributes two pairs as it should.
  • Binary, count and value on every row: See the arithmetic that decides each sign.
  • Running sum column: The flat cumulative behavior that made the sequence famous is displayed live.
  • Start anywhere: Any index from 0 to 1,000,000, up to 10,000 consecutive terms.
  • Balance statistic: The tools show how far the block wanders from equal signs.
  • Reference tab: Polynomial story, Golay/Shapiro history, radar application, OEIS links.
  • Free and private: All computation is local; nothing is uploaded or logged.

How to Use

  1. Set the start index — first n to evaluate (0 to 1,000,000).
  2. Set the count — consecutive values to generate (1 to 10,000).
  3. Generate — each row shows binary(n), the 11-pair count, the parity, and r(n).
  4. Watch the running sum — it hovers near zero because pairs come in canceling runs.
  5. Copy or download — the run as index = value lines.

Examples

Example 1 — First 8 values. Count 8 gives +1, +1, +1, -1, +1, +1, -1, +1. The first -1 arrives at n = 3, whose binary form 11 holds exactly one pair.

Example 2 — The overlap rule. n = 7 (binary 111) holds two pairs — "11" twice — an even tally, so r(7) = +1 even though 7 is dense with 1s.

Example 3 — Three runs of 1s. n = 15 (binary 1111) counts three pairs, giving -1. Long runs alternate in sign by their length minus one.

Example 4 — Balance check. Count 16: six of sixteen values are -1, and the running sum at the end is 4 — small random walks, exactly the promised flatness.

Example 5 — Large indices. Start 987,654, count 8: binary strings of 20 digits, pair counts tiny next to the indices — signs stay determined by the last runs.

Benefits

  • Definition-faithful: Overlapping pairs counted exactly, nothing skipped.
  • Self-explanatory output: Every sign carries its own evidence on the same row.
  • Live balance: The running sum makes the celebrated flatness visible instantly.
  • Flexible ranges: Start deep in the sequence and inspect any window up to 10,000 terms.
  • Clean export: Copy or download index = value lines for analysis.
  • Private by design: No server involved; nothing uploaded, stored or logged.

Frequently Asked Questions

What is the Rudin-Shapiro sequence?
Write n in binary, count the pairs of adjacent 1s (overlapping: "111" counts two pairs), and set r(n) = +1 when the count is even and -1 when odd. The first terms are 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, ...
What is special about it?
It was invented for its polynomial superpowers: the Rudin-Shapiro polynomials have coefficients +1 and -1 yet remain bounded in magnitude (they only grow like the square root of their degree) — dramatically better than random sign polynomials.
What does "adjacent 11 pairs" mean?
Slide a window of length 2 across the binary digits and count every place you see 11. Because windows overlap, "111" contributes two pairs, "1111" three, and so on. Only the parity of the total matters.
Who found it?
The sequence encoding Golay complementary pairs entered the literature through the work of Rudin (1959) and Shapiro (1951); Shapiro used the polynomials to refute a conjecture of Littlewood about product polynomials.
Where is it used?
Low peak-to-average power makes it valuable in polyphase radar and countermeasures, quadrature-amplitude signaling, and in constructing good finite-field and spectral sequences. The complementary-pair idea also underlies Golay codes.
How do partial sums behave?
The average stays small: the largest fluctuation of the first N terms is known to grow roughly like the square root of N — the sequence never wanders far from balance in any range.
Is anything stored or uploaded?
No. The parity computation runs entirely in the browser. Nothing is sent to a server, saved or logged. Copy or download the run before closing the tab.