A033875
Skipping from prime to prime by least powers of 2.
Original entry on oeis.org
2, 3, 5, 7, 11, 13, 17, 19, 23, 31, 47, 79, 83, 211, 227, 229, 233, 241, 257, 769, 773
Offset: 1
2 + 2^0 = 3,
3 + 2^1 = 5,
a(22) = a(21) + 2^955,
a(23) = a(22) + 2^468.
-
NestList[(k = 0; While[! PrimeQ[q = # + 2^k], k++]; q) &, 2, 20] (* Zak Seidov, Jan 24 2017 *)
A059662
Positions of the flipped bits (here they are always set from 0 to 1) in the sequence A059661.
Original entry on oeis.org
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
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.
-
map(floor_log_2,map(abs,DIFF(A059661))); # For floor_log_2, which essentially computes log[2](x) here, see A054429
-
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
Showing 1-2 of 2 results.
Comments