A255066
The trunk of number-of-runs beanstalk (A255056) with reversed subsections.
Original entry on oeis.org
0, 2, 6, 4, 14, 12, 10, 30, 28, 26, 22, 18, 62, 60, 58, 54, 50, 46, 42, 36, 32, 126, 124, 122, 118, 114, 110, 106, 100, 96, 94, 90, 84, 78, 74, 68, 64, 254, 252, 250, 246, 242, 238, 234, 228, 224, 222, 218, 212, 206, 202, 196, 192, 190, 186, 180, 174, 168, 162, 156, 152, 148, 142, 138, 132, 128, 510
Offset: 0
Rows 0 - 5 of the array:
0;
2;
6, 4;
14, 12, 10;
30, 28, 26, 22, 18;
62, 60, 58, 54, 50, 46, 42, 36, 32;
After row 0, the length of row n is given by A255071(n).
Cf.
A255067 (same seq, terms divided by 2).
A175930
Concatenation of run lengths in binary expansion of n, written in base 2, then converted to base 10.
Original entry on oeis.org
1, 3, 2, 6, 7, 5, 3, 7, 13, 15, 14, 10, 11, 7, 4, 12, 15, 27, 26, 30, 31, 29, 15, 11, 21, 23, 22, 14, 15, 9, 5, 13, 25, 31, 30, 54, 55, 53, 27, 31, 61, 63, 62, 58, 59, 31, 28, 20, 23, 43, 42, 46, 47, 45, 23, 15, 29, 31, 30, 18, 19, 11, 6, 14, 27, 51, 50, 62, 63, 61, 31, 55, 109, 111
Offset: 1
6 = 110, two runs, lengths 2 and 1, so we write down 101 and convert it to base 10, getting 5. So a(6) = 5.
-
f[n_] := FromDigits[Flatten[IntegerDigits[Length /@ Split[IntegerDigits[n, \ 2]], 2]], 2]
Array[f, NUMBER OF TERMS]
-
a(n) = my (b=[]); while (n, my (x=valuation(n+(n%2), 2)); b = concat(binary(x), b); n \= 2^x); fromdigits(b, 2) \\ Rémy Sigrist, Jul 02 2019
-
from itertools import groupby
def a(n):
c = "".join(bin(len(list(g)))[2:] for k, g in groupby(bin(n)[2:]))
return int(c, 2)
print([a(n) for n in range(1, 75)]) # Michael S. Branicky, Oct 02 2021
Original entry on oeis.org
2, 5, 6, 11, 12, 13, 14, 23, 24, 25, 26, 27, 28, 29, 30, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
Offset: 1
-
a206332 n = a206332_list !! (n-1)
a206332_list = compl [1..] a092754_list where
compl (u:us) vs'@(v:vs) | u == v = compl us vs
| u /= v = u : compl us vs'
-
a(n) = n + 2<Kevin Ryde, Jun 19 2021
A218614
a(n) = binary code (shown here in decimal) of the position of natural number n in the beanstalk-tree A218778.
Original entry on oeis.org
1, 2, 3, 5, 7, 9, 13, 21, 29, 37, 53, 69, 101, 85, 117, 181, 245, 309, 437, 565, 821, 693, 949, 1205, 1717, 1461, 1973, 2741, 3765, 2485, 3509, 5557, 7605, 9653, 13749, 17845, 26037, 21941, 30133, 38325, 54709, 46517, 62901, 87477, 120245, 79285, 112053, 144821
Offset: 1
As we must traverse to 4 in A218778-tree (see the example there) by first taking the left branch (car) from the root, resulting bit 1 as the least significant bit of the code, then by taking the right branch (cdr) from 3 to get to 4, resulting bit 0 as the second rightmost bit of the code, which when capped with an extra termination-one, results binary code 101, 5 in decimal, thus a(4)=5.
A218615
a(n) = binary code (shown here in decimal) of the position of natural number n in the beanstalk-tree A218776.
Original entry on oeis.org
1, 3, 2, 6, 4, 14, 10, 26, 18, 58, 42, 122, 90, 106, 74, 202, 138, 458, 330, 970, 714, 842, 586, 1866, 1354, 1610, 1098, 3402, 2378, 3658, 2634, 6730, 4682, 14922, 10826, 31306, 23114, 27210, 19018, 59978, 43594, 51786, 35402, 109130, 76362, 117322, 84554, 248394
Offset: 1
As we can traverse to 4 in A218776-tree (see the example there) by taking first the right branch (cdr) from the root, resulting bit 0 as the least significant bit of the code, then by taking the left branch (car) from 3 to get to 4, resulting bit 1 as the second rightmost bit of the code, which when capped with an extra termination-one, results binary code 110, 6 in decimal, thus a(4)=6.
A218790
a(n) = binary code (shown here in decimal) of the position of the predecessor of the natural number pair (2n,2n+1) in the compact beanstalk-tree A218782.
Original entry on oeis.org
1, 3, 5, 13, 21, 37, 53, 117, 181, 309, 437, 693, 949, 1717, 1461, 3509, 5557, 9653, 13749, 21941, 30133, 54709, 46517, 79285, 112053, 210357, 177589, 472501, 308661, 734645, 996789, 2045365, 3093941, 5191093, 7288245, 11482549, 15676853, 28259765, 24065461
Offset: 1
A218791
a(n) = binary code (shown here in decimal) of the position of the predecessor of the natural number pair (2n,2n+1) in the compact beanstalk-tree A218780.
Original entry on oeis.org
1, 2, 6, 10, 26, 58, 42, 74, 202, 458, 330, 842, 586, 1354, 1610, 2634, 6730, 14922, 10826, 27210, 19018, 43594, 51786, 117322, 84554, 182858, 215626, 313930, 477770, 838218, 576074, 1100362, 3197514, 7391818, 5294666, 13683274, 9488970, 22071882, 26266186
Offset: 1
Also, a(n) =
A054429(
A218790(n)). (Note also how the first five or so terms are twice the terms in the beginning of
A218790, shifted by one term.)
A065047
Primes which when written in base 2 and prepended with a 1 produce a prime.
Original entry on oeis.org
3, 5, 13, 29, 37, 43, 71, 83, 101, 113, 163, 193, 211, 223, 257, 311, 317, 347, 479, 509, 547, 577, 613, 643, 673, 709, 787, 823, 853, 877, 883, 907, 1031, 1061, 1181, 1223, 1259, 1283, 1409, 1451, 1481, 1493, 1499, 1511, 1523, 1559, 1583, 1721, 1871, 1973
Offset: 1
13 is in the sequence because 13_10 = 1101_2 and prepending a 1 gives 11101_2 = 29_10, which is a prime.
-
Do[p = Prime[n]; d = IntegerDigits[p, 2]; If[ PrimeQ[ FromDigits[ Prepend[d, 1], 2]], Print[p]], {n, 1, 350} ]
Select[Prime[Range[300]],PrimeQ[FromDigits[Join[{1},IntegerDigits[#,2]],2]]&] (* Harvey P. Dale, Apr 10 2023 *)
-
{ n=0; t=log(2); for (m=1, 10^9, p=prime(m); if (isprime(p + 2^(1 + log(p)\t)), write("b065047.txt", n++, " ", p); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 05 2009
A080565
Binary expansion of n has form 11**...*1.
Original entry on oeis.org
3, 7, 13, 15, 25, 27, 29, 31, 49, 51, 53, 55, 57, 59, 61, 63, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233
Offset: 1
A294991
Let S be the sequence of integer sets defined by the following rules: S(0) = {0}, S(1) = {1} and for any k > 0, S(2*k) = {2*k} U S(k) and S(2*k+1) = {2*k+1} U S(k) U S(k+1) (where X U Y denotes the union of the sets X and Y); a(n) = the number of elements of S(n).
Original entry on oeis.org
1, 1, 2, 3, 3, 4, 4, 5, 4, 6, 5, 6, 5, 7, 6, 7, 5, 8, 7, 8, 6, 8, 7, 8, 6, 9, 8, 9, 7, 9, 8, 9, 6, 10, 9, 10, 8, 10, 9, 10, 7, 10, 9, 10, 8, 10, 9, 10, 7, 11, 10, 11, 9, 11, 10, 11, 8, 11, 10, 11, 9, 11, 10, 11, 7, 12, 11, 12, 10, 12, 11, 12, 9, 12, 11, 12, 10
Offset: 0
The first terms, alongside the corresponding set S(n), are:
n a(n) S(n)
-- ---- -----
0 1 { 0 }
1 1 { 1 }
2 2 { 1, 2 }
3 3 { 1, 2, 3 }
4 3 { 1, 2, 4 }
5 4 { 1, 2, 3, 5 }
6 4 { 1, 2, 3, 6 }
7 5 { 1, 2, 3, 4, 7 }
8 4 { 1, 2, 4, 8 }
9 6 { 1, 2, 3, 4, 5, 9 }
10 5 { 1, 2, 3, 5, 10 }
11 6 { 1, 2, 3, 5, 6, 11 }
12 5 { 1, 2, 3, 6, 12 }
13 7 { 1, 2, 3, 4, 6, 7, 13 }
14 6 { 1, 2, 3, 4, 7, 14 }
15 7 { 1, 2, 3, 4, 7, 8, 15 }
16 5 { 1, 2, 4, 8, 16 }
17 8 { 1, 2, 3, 4, 5, 8, 9, 17 }
18 7 { 1, 2, 3, 4, 5, 9, 18 }
19 8 { 1, 2, 3, 4, 5, 9, 10, 19 }
20 6 { 1, 2, 3, 5, 10, 20 }
See also illustration of the first terms in Links section.
-
a(n) = my (S = Set(n), u = 1); while (u <= #S, my (v = S[#S-u+1]); if (v>1, if (v%2==0, S = setunion(S, Set(v/2)), S = setunion(S, Set([(v-1)/2, (v+1)/2])))); u++;); return (#S)
Comments