login
A392107
a(n) = position of first occurrence of the n-th binary word (using letters 1 and 2 as in A392106) in the sequence of residues modulo 3 of the primes.
2
4, 1, 11, 4, 3, 9, 36, 11, 4, 8, 10, 3, 9, 15, 271, 36, 11, 21, 19, 4, 8, 14, 35, 10, 3, 7, 9, 23, 15, 54, 271, 273, 46, 36, 18, 11, 21, 37, 34, 19, 4, 6, 8, 22, 14, 53, 270, 35, 10, 20, 33, 3, 7, 13, 71, 9, 23, 51, 15, 39, 54, 290, 271, 272, 273, 437, 110
OFFSET
1,1
COMMENTS
Conjecture: every positive integer occurs infinitely many times. In particular, the words that start in position 1 (i.e., the positions of 4 in the sequence), are indexed as 1, 4, 9, 20, 41, 84, 170, 341, 683, 1368, 2737, ...
LINKS
EXAMPLE
The primes mod 3 are (2, 0, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2,...), and the first 14 binary words are 1, 2, 11, 12, 21, 22, 111, 112, 121, 122, 211, 212, 221, 222, so a(1) = 4 because the first word, 1, occurs in position 4; a(6) = 9 because the 6th word, 22, first occurs in position 9.
MATHEMATICA
t=Mod[Prime[Range[10^4]], 3];
w=Flatten[Map[Tuples[{0, 1}, #]&, Range[10]]+1, 1];
Quiet[TakeWhile[Map[SequencePosition[t, #, 1][[1]][[1]]&, w], IntegerQ]]
(* Peter J. C. Moses, Jan 01 2026 *)
PROG
(Magma) t := [ NthPrime(i) mod 3 : i in [1..1000] ]; res := []; for k in [1..10], v in CartesianPower({1, 2}, k) do pos := 0; for i in [1..#t-k+1] do if t[i..i+k-1] eq [v[j] : j in [1..k]] then pos := i; break; end if; end for; if pos eq 0 then break k; end if; Append(~res, pos); end for; res; // Vincenzo Librandi, Jan 21 2026
CROSSREFS
Sequence in context: A094503 A113897 A158753 * A183884 A135552 A181690
KEYWORD
nonn
AUTHOR
Clark Kimberling, Jan 09 2026
STATUS
approved