login
A059662
Positions of the flipped bits (here they are always set from 0 to 1) in the sequence A059661.
3
0, 2, 4, 3, 12, 5, 14, 27, 8, 25, 30, 31, 36, 13, 18, 131, 60, 133, 458, 247, 1040, 21, 618, 283, 300, 209, 6282, 19107, 11792, 3401, 30214, 1211, 3044, 15989, 30194
OFFSET
1,2
COMMENTS
Question: If A059661 could be extended infinitely, would all the natural numbers > 1 eventually appear here once?
a(31) > 27000. - Michael S. Branicky, Oct 02 2022
FORMULA
2^a(n) = A059661(n+1) - A059661(n). - Pontus von Brömssen, Jan 08 2023
EXAMPLE
Starting from A059661(1) = 2, flip (set) bit 0, gives A059661(2) = 3 (= 2+2^0), set bit 2, gives A059661(3) = 7 (3+2^2), set bit 4, gives A059661(4) = 23 (7+2^4), etc.
MAPLE
map(floor_log_2, map(abs, DIFF(A059661))); # For floor_log_2, which essentially computes log[2](x) here, see A054429
PROG
(Python)
from sympy import isprime
from itertools import islice
def agen():
an, bit, p = 2, 1, 0
while True:
while an&bit or not isprime(an+bit): bit <<= 1; p += 1
yield p
an, bit, p = an+bit, 1, 0
print(list(islice(agen(), 26))) # Michael S. Branicky, Oct 01 2022
CROSSREFS
KEYWORD
nonn,more,base
AUTHOR
Antti Karttunen, Feb 03 2001
EXTENSIONS
a(21)-a(27) from Sean A. Irvine, Oct 01 2022
a(28)-a(30) from Michael S. Branicky, Oct 02 2022
a(31)-a(35) from Michael S. Branicky, May 29 2023
STATUS
approved