cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A350577 Prime numbers in A036991.

This page as a plain text file.
%I A350577 #36 Feb 06 2025 10:38:16
%S A350577 3,5,7,11,13,19,23,29,31,43,47,53,59,61,71,79,83,103,107,109,127,151,
%T A350577 157,167,173,179,181,191,199,211,223,239,251,271,283,307,311,317,331,
%U A350577 347,349,359,367,373,379,383,431,439,443,461,463,467,479,487,491,499
%N A350577 Prime numbers in A036991.
%C A350577 This sequence includes A000668.
%C A350577 Conjecture: The sequence is infinite. For example, in the first million primes (see A000040) 304208 numbers are terms of A036991.
%H A350577 Gennady Eremin, <a href="/A350577/b350577.txt">Table of n, a(n) for n = 1..20000</a>
%H A350577 Gennady Eremin, <a href="https://arxiv.org/abs/2405.16143">Partitioning the set of natural numbers into Mersenne trees and into arithmetic progressions; Natural Matrix and Linnik's constant</a>, arXiv:2405.16143 [math.CO], 2024. See pp. 10, 14.
%F A350577 Intersection of A000040 and A036991.
%p A350577 q:= proc(n) local l, t, i; l:= Bits[Split](n); t:=0;
%p A350577       for i to nops(l) do t:= t-1+2*l[i];
%p A350577         if t<0 then return false fi
%p A350577       od: true
%p A350577     end:
%p A350577 select(isprime and q, [$2..500])[];  # _Alois P. Heinz_, Jan 07 2022
%t A350577 q[n_] := PrimeQ[n] && AllTrue[Accumulate[(-1)^Reverse[IntegerDigits[n, 2]]], # <= 0 &]; Select[Range[500], q] (* _Amiram Eldar_, Jan 07 2022 *)
%o A350577 (Python)
%o A350577 from sympy import isprime
%o A350577 def ok(n):
%o A350577     if n == 0: return True
%o A350577     count = {"0": 0, "1": 0}
%o A350577     for bit in bin(n)[:1:-1]:
%o A350577         count[bit] += 1
%o A350577         if count["0"] > count["1"]: return False
%o A350577     return isprime(n)
%o A350577 print([k for k in range(3, 500, 2) if ok(k)]) # _Michael S. Branicky_, Jan 07 2022
%Y A350577 Subsequence of A000040, A005408, A036991, A042987, A045395, A095070, A095074, A216285.
%Y A350577 Cf. A000668.
%K A350577 nonn,base
%O A350577 1,1
%A A350577 _Gennady Eremin_, Jan 07 2022