# sequence

Published articles for sequence.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Zaks's suffix-reversal algorithm for generating permutations

DevFeed: [Zaks's suffix-reversal algorithm for generating permutations](<https://devfeed.tech/articles/an-elegant-formulation-inspired-by-the-one-and-only-paper-bill-gates-ever-wrote-37563.md>)

Original publisher: [Read original article](<https://blog.klipse.tech/aboulafia/2026/07/06/an-elegant-formulation-inspired-by-bill-gates.html>)

Author: Yehonathan Sharvit

Published: 2026-07-06T08:00:00Z

Content type: article

Language: en

Sources: [Klipse](<https://devfeed.tech/sources/klipse.md>)

Topics: [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Sorting](<https://devfeed.tech/topics/sorting.md>), [ordering](<https://devfeed.tech/topics/ordering.md>)

Tags: [aboulafia](<https://devfeed.tech/tags/aboulafia.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [math](<https://devfeed.tech/tags/math.md>), [permutations](<https://devfeed.tech/tags/permutations.md>), [reversing](<https://devfeed.tech/tags/reversing.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [sorting](<https://devfeed.tech/tags/sorting.md>)

### AI overview

This second article in a series connects Aboulafia's recursive Tserouf permutation algorithm with Shimon Zaks's 1984 algorithm. It explains how Zaks generates permutations by repeatedly reversing suffixes and describes the recursive sequence of suffix lengths behind the ordering.

### Source excerpt

Aboulafia's Tserouf - Part 2 of 4 <- Previous: An algorithm ignored for 700 years - Next: Too big to draw, but yet drawable ->

## A guide to Transformer architecture in modern language models

DevFeed: [A guide to Transformer architecture in modern language models](<https://devfeed.tech/articles/a-deep-dive-into-the-transformer-architecture-33578.md>)

Original publisher: [Read original article](<https://blog.algomaster.io/p/transformer-architecture>)

Author: Ashish Pratap Singh

Published: 2026-05-14T04:15:11Z

Content type: tutorial

Language: en

Sources: [AlgoMaster Newsletter](<https://devfeed.tech/sources/algomaster-newsletter.md>)

Topics: [Transformer architecture](<https://devfeed.tech/topics/transformer-architecture.md>), [LLMs](<https://devfeed.tech/topics/llms.md>), [Transformer](<https://devfeed.tech/topics/transformer.md>)

Tags: [architecture-pattern](<https://devfeed.tech/tags/architecture-pattern.md>), [better](<https://devfeed.tech/tags/better.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [layer](<https://devfeed.tech/tags/layer.md>), [llms](<https://devfeed.tech/tags/llms.md>), [model](<https://devfeed.tech/tags/model.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [performance](<https://devfeed.tech/tags/performance.md>), [semantics](<https://devfeed.tech/tags/semantics.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [tokens](<https://devfeed.tech/tags/tokens.md>), [transformer-architecture](<https://devfeed.tech/tags/transformer-architecture.md>), [transformers](<https://devfeed.tech/tags/transformers.md>)

### AI overview

This tutorial explains the Transformer architecture, including its original encoder-decoder design for translation and the decoder-only variant used for modern language generation. It describes decoder components such as masked multi-head self-attention, feed-forward networks, layer normalization, and residual connections, and introduces the Pre-LayerNorm pattern.

### Source excerpt

A single 2017 research paper changed the future of AI forever and gave rise to multiple unicorn companies.

## The OEIS meta sequence and subway stations

DevFeed: [The OEIS meta sequence and subway stations](<https://devfeed.tech/articles/the-oeis-meta-sequence-and-subway-stations-40520.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/shortform/2026-04-09-0556/>)

Published: 2026-04-09T13:55:17Z

Content type: opinion

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Sequences](<https://devfeed.tech/topics/sequences.md>), [math](<https://devfeed.tech/topics/math.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [depths-of-oeis](<https://devfeed.tech/tags/depths-of-oeis.md>), [new-york-city](<https://devfeed.tech/tags/new-york-city.md>), [numberphile](<https://devfeed.tech/tags/numberphile.md>), [oeis](<https://devfeed.tech/tags/oeis.md>), [quirk](<https://devfeed.tech/tags/quirk.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [sequences](<https://devfeed.tech/tags/sequences.md>), [shortform](<https://devfeed.tech/tags/shortform.md>), [train](<https://devfeed.tech/tags/train.md>)

### AI overview

This commentary examines OEIS sequence A051070, whose nth term is the nth entry of sequence A_n, or -1 when that sequence lacks enough terms. It highlights unusually large or unknown values, subway-stop sequences included in the OEIS, and self-referential questions involving A051070 and A102288.

### Source excerpt

A051070 is a sequence about OEIS sequences. a(n) is the n-th term in sequence A_n (or -1 if A_n doesn't have enough terms). So the first term in A051070 is 1 because A000001 is the number of groups of order n, and that sequence has 1 as its entry in index 1. A000002 is the Kolakoski sequence (what? For another time) and has value 2 in entry 2. The sequence continues: 1, 2, 1, 0, 2, 3, 0, 7, 8, 4, 63, 1, 316, ...

## How TCP Handshake Works

DevFeed: [How TCP Handshake Works](<https://devfeed.tech/articles/how-tcp-handshake-works-34678.md>)

Original publisher: [Read original article](<https://newsletter.systemdesigncodex.com/p/how-tcp-handshake-works>)

Author: Saurabh Dashora

Published: 2026-03-31T08:17:52Z

Content type: tutorial

Language: en

Sources: [System Design Codex](<https://devfeed.tech/sources/system-design-codex.md>)

Topics: [Handshake](<https://devfeed.tech/topics/handshake.md>), [client](<https://devfeed.tech/topics/client.md>), [servers](<https://devfeed.tech/topics/servers.md>)

Tags: [client](<https://devfeed.tech/tags/client.md>), [communication](<https://devfeed.tech/tags/communication.md>), [http-3](<https://devfeed.tech/tags/http-3.md>), [quic](<https://devfeed.tech/tags/quic.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [server](<https://devfeed.tech/tags/server.md>), [tcp](<https://devfeed.tech/tags/tcp.md>), [tcp-handshake](<https://devfeed.tech/tags/tcp-handshake.md>)

### AI overview

A tutorial explaining the TCP three-way handshake. It describes how a client sends SYN, a server responds with SYN-ACK, and the client completes the connection with ACK, including the role of initial sequence numbers and control flags.

### Source excerpt

The 3 step process

## Waiting for PostgreSQL 19 - Sequence synchronization in logical replication.

DevFeed: [Waiting for PostgreSQL 19 - Sequence synchronization in logical replication.](<https://devfeed.tech/articles/waiting-for-postgresql-19-sequence-synchronization-in-logical-replication-33669.md>)

Original publisher: [Read original article](<https://www.depesz.com/2025/11/11/waiting-for-postgresql-19-sequence-synchronization-in-logical-replication/>)

Author: depesz

Published: 2025-11-11T12:24:23Z

Content type: tutorial

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Sequences](<https://devfeed.tech/topics/sequences.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [logical](<https://devfeed.tech/tags/logical.md>), [pg19](<https://devfeed.tech/tags/pg19.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [psql](<https://devfeed.tech/tags/psql.md>), [publications](<https://devfeed.tech/tags/publications.md>), [replication](<https://devfeed.tech/tags/replication.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [sequences](<https://devfeed.tech/tags/sequences.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>), [upgrades](<https://devfeed.tech/tags/upgrades.md>), [waiting](<https://devfeed.tech/tags/waiting.md>)

### AI overview

This article demonstrates PostgreSQL 19's planned sequence synchronization for logical replication. It sets up source and destination databases, tests sequence synchronization, finds that resynchronization must be manually invoked, and reports that synchronizing 10,000 sequences took about one second in the author's test.

### Source excerpt

First, on 9th of October 2025, Amit Kapila committed patch: Add "ALL SEQUENCES" support to publications. This patch adds support for the ALL SEQUENCES clause in publications, enabling synchronization/replication of all sequences that is useful for upgrades. Publications can now include all sequences via FOR ALL SEQUENCES. psql enhancements: \d shows publications for ... Continue reading "Waiting for PostgreSQL 19 - Sequence synchronization in logical replication."

## clamp / median / range

DevFeed: [clamp / median / range](<https://devfeed.tech/articles/clamp-median-range-36218.md>)

Original publisher: [Read original article](<https://dotat.at/@/2025-07-02-cmp.html>)

Published: 2025-07-02T01:33:08Z

Content type: article

Language: en

Sources: [Tony Finch's blog](<https://devfeed.tech/sources/tony-finch-s-blog.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [function](<https://devfeed.tech/topics/function.md>), [syntax](<https://devfeed.tech/topics/syntax.md>), [iteration](<https://devfeed.tech/topics/iteration.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [function](<https://devfeed.tech/tags/function.md>), [languages](<https://devfeed.tech/tags/languages.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

The article explores stylistic conventions for comparison operators, including chained comparisons, ordering values from least to greatest, and arranging clamp arguments to match that order. It then considers median-of-three implementations that are insensitive to argument order and proposes a speculative range syntax for pattern matching, iteration, and slicing.

### Source excerpt

Here are a few tangentially-related ideas vaguely near the theme of comparison operators. comparison style clamp style clamp is median clamp in range range style style clash? comparison style Some languages such as BCPL, Icon, Python have chained comparison operators, like if min <= x <= max: ... In languages without chained comparison, I like to write comparisons as if they were chained, like, if min <= x && x <= max { // ... } A rule of thumb is to prefer less than (or equal) operators and avoid greater than. In a sequence of comparisons, order values from (expected) least to greatest. clamp style The clamp() function ensures a value is between some min and max, def clamp(min, x, max): if x < min: return min if max < x: return max return x I like to order its arguments matching the expected order of the values, following my rule of thumb for comparisons - and the description of what clamp() does. (I used this flavour of clamp() in my article about GCRA.) But I seem to be unusual in this preference, based on a few examples I have seen recently. clamp is median Last month, Fabian Giesen pointed out a way to resolve this difference of opinion: A function that returns the median of three values is equivalent to a clamp() function that doesn't care about the order of its arguments. This version is written so that it returns NaN if any of its arguments is NaN. (When an argument is NaN, both of its comparisons will be false.) fn med3(a: f64, b: f64, c: f64) -> f64 { match (a <= b, b <= c, c <= a) { (false, false, false) => f64::NAN, (false, false, true) => b, // a > b > c (false, true, false) => a, // c > a > b (false, true, true) => c, // b <= c <= a (true, false, false) => c, // b > c > a (true, false, true) => a, // c <= a <= b (true, true, false) => b, // a <= b <= c (true, true, true) => b, // a == b == c } } When two of its arguments are constant, med3() should compile to the same code as a simple clamp(); but med3()'s misuse-resistance comes at a small cost when t

## Getting started with small-step operational semantics

DevFeed: [Getting started with small-step operational semantics](<https://devfeed.tech/articles/getting-started-with-small-step-operational-semantics-35841.md>)

Original publisher: [Read original article](<https://temporal.io/blog/getting-started-with-small-step-operational-semantics>)

Author: Dominik Tornow

Published: 2023-04-03T16:00:00Z

Content type: tutorial

Language: en

Sources: [Temporal Blog](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>)

Tags: [getting-started](<https://devfeed.tech/tags/getting-started.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [recovery](<https://devfeed.tech/tags/recovery.md>), [retries](<https://devfeed.tech/tags/retries.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [state](<https://devfeed.tech/tags/state.md>), [temporal-concepts](<https://devfeed.tech/tags/temporal-concepts.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

### AI overview

This tutorial introduces small-step operational semantics through SagaLang, a minimal programming language for specifying sagas as sequences of transactions with retries and compensations. It explains how programs generate computations through sequences of states and state transitions.

### Source excerpt

Getting started with small-step operational semantics? Read how to design SagaLang, a tiny "programming language" for the development of sagas to illustrate the ideas behind SOS.

## Carnival of Mathematics #197

DevFeed: [Carnival of Mathematics #197](<https://devfeed.tech/articles/carnival-of-mathematics-197-40448.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2021/09/01/carnival-of-mathematics-197/>)

Published: 2021-09-01T08:00:00Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Mathematics](<https://devfeed.tech/topics/mathematics.md>), [Graphics](<https://devfeed.tech/topics/graphics.md>), [Simulation](<https://devfeed.tech/topics/simulation.md>), [Data Science](<https://devfeed.tech/topics/data-science.md>)

Tags: [carnival](<https://devfeed.tech/tags/carnival.md>), [dataset](<https://devfeed.tech/tags/dataset.md>), [fibonacci](<https://devfeed.tech/tags/fibonacci.md>), [folding](<https://devfeed.tech/tags/folding.md>), [functional-analysis](<https://devfeed.tech/tags/functional-analysis.md>), [geometric-series](<https://devfeed.tech/tags/geometric-series.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [inner-product](<https://devfeed.tech/tags/inner-product.md>), [knot-theory](<https://devfeed.tech/tags/knot-theory.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [oeis](<https://devfeed.tech/tags/oeis.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [sieve](<https://devfeed.tech/tags/sieve.md>), [simulation](<https://devfeed.tech/tags/simulation.md>), [umap](<https://devfeed.tech/tags/umap.md>), [visualization](<https://devfeed.tech/tags/visualization.md>)

### AI overview

The 197th Carnival of Mathematics introduces the number 197 and highlights mathematical and technical topics including curve untangling, folding equilateral triangles without measurement, and criticism of UMAP and t-SNE dimensionality reduction.

### Source excerpt

Welcome to the 197th Carnival of Mathematics! 197 is an unseemly number, as you can tell by the Wikipedia page which currently says that it has "indiscriminate, excessive, or irrelevant examples." How deviant. It's also a Repfigit, which means if you start a fibonacci-type sequence with the digits 1, 9, 7, and then continue with $ a_n = a_{i-3} + a_{i-2} + a_{i-1}$, then 197 shows up in the sequence. Indeed: 1, 9, 7, 17, 33, 57, 107, 197, ...

## Counting hash collisions with the birthday paradox

DevFeed: [Counting hash collisions with the birthday paradox](<https://devfeed.tech/articles/counting-hash-collisions-with-the-birthday-paradox-35234.md>)

Original publisher: [Read original article](<http://matt.might.net/articles/counting-hash-collisions/>)

Published: 2015-07-17T03:33:41Z

Content type: tutorial

Language: en

Sources: [Matt Might](<https://devfeed.tech/sources/matt-might.md>)

Topics: [hash](<https://devfeed.tech/topics/hash.md>), [hashing](<https://devfeed.tech/topics/hashing.md>), [function](<https://devfeed.tech/topics/function.md>), [Network](<https://devfeed.tech/topics/network.md>)

Tags: [hash](<https://devfeed.tech/tags/hash.md>), [hashing](<https://devfeed.tech/tags/hashing.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

This technical note derives a closed-form formula for the expected number of hash collisions among n values when a uniform hash function has a range of D possible outputs. It explains the connection to the birthday paradox and clarifies that the formula counts sequential matching events rather than unique hits or collision pairings.

### Source excerpt

The birthday paradox observes that in a room of 23 people, the odds that at least two people share a birthday is 50% The same logic that drives matching birthdays also drives the probability that one can find collisions with a hash function. In other words, if you have a uniform hashing function that outputs a value between 1 and 365 for any input, the probability that two hashes would collide in a set of 23 values is also 50% Another useful calculation is the expected number of collisions for a sequence of \(n\) values when the range of the hash function contains \(D\) hashes. The closed form solution is: \[ n - D + D \left( \frac{D-1}{D} \right)^n \] There are a few places online that have this (or an equivalent) closed form solution listed, but I couldn't find anywhere that included the derivation of this form, so I've rederived it and posted it here as a technical note. (My present interest in this calculation comes from the number of matches that will happen in a patient-matching network that attempts to match patients having the same disease, assuming the are \(D\) total diseases possible and \(n\) patients in the network.) Read below for the derivation in terms of generalized birthdays. Click here to read the rest of the article

## Infinitely Many Primes (Using Topology)

DevFeed: [Infinitely Many Primes (Using Topology)](<https://devfeed.tech/articles/infinitely-many-primes-using-topology-40287.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2012/09/26/infinitely-many-primes-using-topology/>)

Published: 2012-09-26T11:51:28Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Sequences](<https://devfeed.tech/topics/sequences.md>), [structure](<https://devfeed.tech/topics/structure.md>)

Tags: [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [numbers](<https://devfeed.tech/tags/numbers.md>), [primes](<https://devfeed.tech/tags/primes.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [using](<https://devfeed.tech/tags/using.md>)

### AI overview

A proof that there are infinitely many prime numbers using a topology on the integers whose basis consists of two-sided arithmetic progressions. Assuming finitely many primes leads to a finite open complement, contradicting the fact that no finite set is open in this topology.

### Source excerpt

Problem: Prove there are infinitely many prime numbers. Solution: First recall that an arithmetic progression with difference $ d$ is a sequence of integers $ a_n \subset \mathbb{Z}$ so that for every pair $ a_k, a_{k+1}$ the difference $ a_{k+1} - a_k = d$. We proceed be defining a topology on the set of integers by defining a basis $ B$ of unbounded (in both directions) arithmetic progressions. That is, an open set in this topology is an arbitrary union of arithmetic progressions from $ -\infty$ to $ \infty$.

## Streaming Median

DevFeed: [Streaming Median](<https://devfeed.tech/articles/streaming-median-40277.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2012/06/14/streaming-median/>)

Published: 2012-06-14T22:03:55Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Streaming](<https://devfeed.tech/topics/streaming.md>), [Python](<https://devfeed.tech/topics/python.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [generators](<https://devfeed.tech/topics/generators.md>), [iteration](<https://devfeed.tech/topics/iteration.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [approximation](<https://devfeed.tech/tags/approximation.md>), [big-data](<https://devfeed.tech/tags/big-data.md>), [data-analysis](<https://devfeed.tech/tags/data-analysis.md>), [element](<https://devfeed.tech/tags/element.md>), [generators](<https://devfeed.tech/tags/generators.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [infinite](<https://devfeed.tech/tags/infinite.md>), [input](<https://devfeed.tech/tags/input.md>), [iteration](<https://devfeed.tech/tags/iteration.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [median](<https://devfeed.tech/tags/median.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [streaming-data](<https://devfeed.tech/tags/streaming-data.md>), [yield](<https://devfeed.tech/tags/yield.md>)

### AI overview

This tutorial presents a Python generator that approximates the median of a potentially infinite integer sequence using constant space. The algorithm adjusts its current estimate by one for each input value that is above or below the estimate, and the article discusses how changing stream distributions affect the result.

### Source excerpt

Problem: Compute a reasonable approximation to a "streaming median" of a potentially infinite sequence of integers. Solution: (in Python) def streamingMedian(seq): seq = iter(seq) m = 0 for nextElt in seq: if m > nextElt: m -= 1 elif m < nextElt: m += 1 yield m Discussion: Before we discuss the details of the Python implementation above, we should note a few things. First, because the input sequence is potentially infinite, we can't store any amount of information that is increasing in the length of the sequence.

## Theorem Proving in Mathematics

DevFeed: [Theorem Proving in Mathematics](<https://devfeed.tech/articles/theorem-proving-in-mathematics-40755.md>)

Original publisher: [Read original article](<https://radek.io/posts/theorem-proving-in-mathematics/>)

Published: 2011-10-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>), [Mathematics](<https://devfeed.tech/topics/mathematics.md>), [math](<https://devfeed.tech/topics/math.md>)

Tags: [induction](<https://devfeed.tech/tags/induction.md>), [logic](<https://devfeed.tech/tags/logic.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [predicate](<https://devfeed.tech/tags/predicate.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [statement](<https://devfeed.tech/tags/statement.md>)

### AI overview

This tutorial introduces mathematical proof as deductive reasoning from axioms and previously established theorems. It explains direct proof with a worked equation example and begins discussing proof by mathematical induction and its connection to predicate logic.

### Source excerpt

The most common methods of proving you're explained