OFFSET
1,3
COMMENTS
a(n) and base-2 lunar prime density, a(n)/n, for some n up to 2^39 are
k n = 2^k a(n) a(n)/n
-- ------------ ------------ ----------
1 2 1 0.5
5 32 11 0.34375
10 1024 323 0.31542...
15 32768 5956 0.35430...
20 1048576 424816 0.40513...
25 33554432 14871345 0.44320...
30 1073741824 502585213 0.46806...
35 34359738368 16593346608 0.48292...
39 549755813888 269325457277 0.48990...
Conjecture: base-2 lunar prime density approaches 0.5 as n tends to infinity, i.e., lim_{n->oo} a(n)/n = 0.5 (see Comments section in A342676).
a(n) is the n-th partial sum of A342704.
LINKS
D. Applegate, M. LeBrun and N. J. A. Sloane, Dismal Arithmetic, arXiv:1107.1130 [math.NT], 2011.
PROG
(Python)
def addn(m1, m2):
s1, s2 = bin(m1)[2:].zfill(0), bin(m2)[2:].zfill(0)
len_max = max(len(s1), len(s2))
return int(''.join(max(i, j) for i, j in zip(s1.rjust(len_max, '0'), s2.rjust(len_max, '0'))))
def muln(m1, m2):
s1, s2, prod = bin(m1)[2:].zfill(0), bin(m2)[2:].zfill(0), '0'
for i in range(len(s2)):
k = s2[-i-1]
prod = addn(int(str(prod), 2), int(''.join(min(j, k) for j in s1), 2)*2**i)
return prod
m = 1; m_size = 7; a = 0; L_im = [1]
while m <= 2**m_size:
for i in range(2, m + 1):
im_st = str(muln(i, m)); im = int(im_st, 2); im_len = len(im_st)
if im_len > m_size: break
if im not in L_im: L_im.append(im)
if m not in L_im: a += 1
print(a); m += 1
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ya-Ping Lu, Mar 18 2021
STATUS
approved