/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ import FormalConjecturesUtil

Conjectures associated with A109227

Binary strings that have 1's where primes occur, 0's elsewhere and every term ends with the $n$-th prime index.

Conjecture: $a(2)$ and $a(121)$ are primes. Are there any more?

References:

namespace OeisA109227open Nat List

The primary defining sequence a. $a(n)$ is the natural number whose decimal digits are given by the binary string of length $p_n$ where the $k$-th digit is $1$ if $k$ is prime and $0$ otherwise, with leading zeros dropped.

noncomputable def a (n : ) : := if n = 0 then 0 else let pN : := Nat.nth Nat.Prime (n - 1) let primeBitsFull : List := (range (pN + 1)).map (fun i => if i.Prime then 1 else 0 ) let primeBitsTrimmed := primeBitsFull.dropWhile (· = 0) ofDigits 10 primeBitsTrimmed.reverse

Term theorems verifying the first few values of the sequence against the official OEIS b-file

@[category test, AMS 11] theorem a_0 : a 0 = 0 := a 0 = 0 All goals completed! 🐙ofDigits 10 (dropWhile (fun x decide (x = 0)) (map (fun i if Nat.Prime i then 1 else 0) (range (2 + 1)))).reverse = 1 All goals completed! 🐙ofDigits 10 (dropWhile (fun x decide (x = 0)) (map (fun i if Nat.Prime i then 1 else 0) (range (3 + 1)))).reverse = 11 All goals completed! 🐙ofDigits 10 (dropWhile (fun x decide (x = 0)) (map (fun i if Nat.Prime i then 1 else 0) (range (5 + 1)))).reverse = 1101 All goals completed! 🐙ofDigits 10 (dropWhile (fun x decide (x = 0)) (map (fun i if Nat.Prime i then 1 else 0) (range (7 + 1)))).reverse = 110101 All goals completed! 🐙

Conjecture: $a(2)$ and $a(121)$ are primes. Are there any more?

@[category research open, AMS 11] theorem conjecture : answer(sorry) n > 0, n 2 n 121 (a n).Prime := True n > 0, n 2 n 121 Nat.Prime (a n) All goals completed! 🐙end OeisA109227