Post Reply 
OEIS sequences and LCG from recent discussions
12-21-2022, 03:44 PM (This post was last modified: 12-21-2022 09:23 PM by Allen.)
Post: #1
OEIS sequences and LCG from recent discussions
Good morning!
Based on John Keith's recent discussion on the Rudin-Shapiro Sequence and some recent questions from Gerald about making calculator programs to generate OEIS sequences:
  1. A244953
  2. A167390

I generalized the search routine from the Rudin-Shapiro discussion thread and searched ALL binary sequences from the OEIS catalog. Although most are relatively short periodic sequences (uninteresting?) and perhaps can be generated some other/faster/better way, there are a few of the sequences that have some puzzling artifacts and coincidences.

For example, the Sage Reference manual mentions Christoffel words of fractional slope:
  • The Christoffel word of slope \( p/q\) is obtained from the Cayley graph of \( Z /(p+q)Z \)with generator \(q \) as follows. If \( u \rightarrow v \) is an edge in the Cayley graph, then \( v=u+p \mod p+q \). Label the edge \( u \rightarrow v \) with 1 if \( u<v \), and 0 otherwise. The Christoffel word is the word obtained by reading the edge labels along the cycle beginning from 0.


The entire list of sequences this found, along with 41/42 LCG template programs for each one can be found here:
[41C,42S] Linear Congruential Generator Programs that generate Binary OEIS sequences

Teaser list:
  • A000035 : Period 2: repeat [0, 1]; a(n) = n mod 2; parity of n.
  • A011558 : Expansion of (x + x^3)/(1 + x + ... + x^4) mod 2.
  • A011655 : Period 3: repeat [0, 1, 1].
  • A011656 : A binary m-sequence: expansion of reciprocal of x^3 + x^2 + 1 (mod 2), shifted by 2 initial 0's.
  • A060584 : Compare ultimate and penultimate digits of n base 3, i.e., 0 if n mod 3 = floor(n/3) mod 3, 1 otherwise; also 0 if (n mod 9) is a multiple of 4, 1 otherwise.
  • A074937 : Let c(1) = c(2) = 1, c(n+2) = 1/(c(n+1)+c(n)); then a(n) = (1+sign(c(n)-sqrt(1/2))/2.
  • A079979 : Characteristic function of multiples of six.
  • A079998 : The characteristic function of the multiples of five.
  • A082848 : Duplicate of <a href="/A078588" title="a(n) = 1 if the integer multiple of phi nearest n is greater than n, otherwise 0, where phi = (1+sqrt(5))/2.">A078588</a>.
  • A088911 : Period 6: repeat [1, 1, 1, 0, 0, 0].
  • A093719 : a(n) = (n mod 2)^(n mod 3).
  • A094875 : a(n)=1 if floor(Pi*10^n) is prime, otherwise a(n)=0.
  • A095130 : Expansion of (x+x^2)/(1-x^6); period 6: repeat [0, 1, 1, 0, 0, 0].
  • A097325 : Period 6: repeat [0, 1, 1, 1, 1, 1].
  • A098457 : Farey Bisection Expansion of sqrt(7).
  • A100283 : a(n) = floor(p*(n+1)) - floor(p*(n)) - 1 where p = Padovan plastic number = 1.324718... (cf. <a href="/A060006" title="Decimal expansion of real root of x^3 - x - 1 (the plastic constant).">A060006</a>).
  • A105563 : a(n) = if (exactly 4 Fibonacci numbers exist with exactly n digits) then 1, otherwise 0.
  • A108357 : Expansion of (1+x^2+x^4)/(1-x^8).
  • A109720 : Periodic sequence {0,1,1,1,1,1,1} or n^6 mod 7.
  • A115790 : 1 - (Floor((n+1)*Pi)-Floor(n*Pi)) mod 2.
  • A121262 : The characteristic function of the multiples of four.
  • A126565 : a(n) = ceiling(sin(n)*cos(n)).
  • A131078 : Periodic sequence (1, 1, 1, 1, 0, 0, 0, 0).
  • A131532 : Period 6: repeat [0, 0, 0, 0, 1, 1].
  • A131719 : Period 6: repeat [0, 1, 1, 1, 1, 0].
  • A131735 : Period 6: repeat [0, 0, 1, 1, 1, 1].
  • A133872 : Period 4: repeat [1, 1, 0, 0].
  • A141260 : a(n) = 1 if n == {0,1,3,4,5,7,9,11} mod 12, otherwise a(n) = 0.
  • A144595 : Christoffel word of slope 4/7.
  • A144596 : Christoffel word of slope 2/7.
  • A144597 : Christoffel word of slope 3/7.
  • A144598 : Christoffel word of slope 5/7.
  • A144599 : Christoffel word of slope 6/7.
  • A144600 : Christoffel word of slope 2/11.
  • A144601 : Christoffel word of slope 3/11.
  • A144602 : Christoffel word of slope 4/11.
  • A144603 : Christoffel word of slope 5/11.
  • A144604 : Christoffel word of slope 6/11.
  • A144605 : Christoffel word of slope 7/11.
  • A144606 : Christoffel word of slope 8/11.
  • A144607 : Christoffel word of slope 9/11.
  • A144608 : Christoffel word of slope 10/11.
  • A145568 : Characteristic function of numbers relatively prime to 11.
  • A152822 : Periodic sequence [1,1,0,1] of length 4.
  • A165211 : Period 8: repeat [0,1,0,1,1,0,1,0].
  • A166486 : Periodic sequence [0,1,1,1] of length 4.
  • A168181 : Characteristic function of numbers that are not multiples of 8.
  • A168182 : Characteristic function of numbers that are not multiples of 9.
  • A168184 : Characteristic function of numbers that are not multiples of 10.
  • A168185 : Characteristic function of numbers that are not multiples of 12.
  • A171386 : The characteristic function of 2 and 3: 1 if n is prime such that either n-1 or n+1 is prime, else 0.
  • A172051 : Decimal expansion of 1/999999.
  • A173857 : Expansion of 3/2 in base phi.
  • A179850 : Characteristic function of numbers that are congruent to {0, 1, 3, 4} mod 5.
  • A185017 : Characteristic function of 7.
  • A187074 : a(n) = 0 if and only if n is of the form 3*k or 4*k + 2, otherwise a(n) = 1.
  • A191152 : [4n*e]-2[2n*e], where [ ]=floor.
  • A195062 : Period 7: repeat [1, 0, 1, 0, 1, 0, 1].
  • A204418 : Periodic sequence 1,0,1,..., arranged in a triangle.
  • A232990 : Period 5: repeat [1,0,0,1,0].
  • A232991 : Period 6: repeat [1, 0, 0, 0, 1, 0].
  • A241979 : (0,1) sequence such that lengths of three consecutive runs are always distinct.
  • A267142 : The characteristic function of the multiples of 9.
  • A272532 : Single bit representation of the sum of two sinusoids with periods 2 and 2*sqrt(2).
  • A283437 : Periodic {1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1}.
  • A320106 : Möbius transform of <a href="/A320107" title="a(n) = A001227(A252463(n)).">A320107</a>.
  • A354354 : a(n) = 1 if n is neither a multiple of 2 nor 3, and otherwise 0.

17bii | 32s | 32sii | 41c | 41cv | 41cx | 42s | 48g | 48g+ | 48gx | 50g | 30b

Find all posts by this user
Quote this message in a reply
12-22-2022, 02:34 AM
Post: #2
RE: OEIS sequences and LCG from recent discussions
Nice. I'll take a detailed look later.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)