OFFSET

1,1

COMMENTS

A subsequence of A080943 and first differs from it at n = 42: A080943(42) = 55 is not a term of this sequence.

Numbers k that have exactly 2 divisors d such that the bitwise AND of k and d is equal to d, or equivalently, the bitwise OR of k and d is equal to k. These two divisors are k and the highest power of 2 dividing k, A006519(k).

Includes all the even squarefree semiprimes (i.e., the odd primes doubled, A100484 \ {4}).

If k is a term then 2*k is also a term. The primitive terms are the odd terms of this sequence, A363691.

The numbers of terms not exceeding 10^k, for k = 1, 2, ..., are 6, 76, 681, 6268, 60002, 587247, 5811449, 57817051, 576781821, 5761341533, 57583082392, 575687822743, ... . Apparently, the asymptotic density of this sequence exists and equals 0.575... .

LINKS

Amiram Eldar, Table of n, a(n) for n = 1..10000

MATHEMATICA

q[n_] := DivisorSum[n, Boole[BitOr[#, n] == n] &] == 2; Select[Range[100], q]

PROG

(PARI) is(n) = sumdiv(n, d, bitor(d, n) == n) == 2;

(Python)

from itertools import count, islice

from sympy import divisors

def A363690_gen(startvalue=2): # generator of terms >= startvalue

return filter(lambda n:(m:=n&-n)!=n and all(d==m or d==n or n|d!=n for d in divisors(n, generator=True)), count(max(startvalue, 2)))

CROSSREFS

KEYWORD

nonn,base,easy

AUTHOR

Amiram Eldar, Jun 16 2023

STATUS

approved