login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A358258 First n-bit number to appear in Van Eck's sequence (A181391). 2
0, 2, 6, 9, 17, 42, 92, 131, 307, 650, 1024, 2238, 4164, 8226, 17384, 33197, 67167, 133549, 269119, 525974, 1055175, 2111641, 4213053, 8444257, 16783217, 33601813, 67405064, 134239260, 268711604, 538400994, 1076155844, 2152693259, 4299075300, 8594396933, 17203509931 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Binary version of A358168.
LINKS
EXAMPLE
First terms written in binary, substituting "." for 0 to enhance the pattern of 1's.
n a(n) a(n)_2
-------------------------------------
1 0 .
2 2 1.
3 6 11.
4 9 1..1
5 17 1...1
6 42 1.1.1.
7 92 1.111..
8 131 1.....11
9 307 1..11..11
10 650 1.1...1.1.
11 1024 1..........
12 2238 1...1.11111.
13 4164 1.....1...1..
14 8226 1.......1...1.
15 17384 1....11111.1...
16 33197 1......11.1.11.1
17 67167 1.....11..1.11111
18 133549 1.....1..11.1.11.1
19 269119 1.....11.11..111111
20 525974 1........11.1..1.11.
21 1055175 1.......11..111...111
22 2111641 1.......111...1..11..1
23 4213053 1.......1..1..1..1111.1
24 8444257 1.......11.11..1.11....1
MATHEMATICA
nn = 2^20; q[_] = False; q[0] = True; a[_] = 0; c[_] = -1; c[0] = 2; m = 1; {0}~Join~Rest@ Reap[Do[j = c[m]; k = m; c[m] = n; m = 0; If[j > 0, m = n - j]; If[! q[#], Sow[k]; q[#] = True] & @ IntegerLength[k, 2], {n, 3, nn}] ][[-1, -1]]
PROG
(Python)
from itertools import count
def A358258(n):
b, bdict, k = 0, {0:(1, )}, 1<<n-1 if n > 1 else 0
for m in count(2):
if b >= k:
return b
if len(l := bdict[b]) > 1:
b = m-1-l[-2]
if b in bdict:
bdict[b] = (bdict[b][-1], m)
else:
bdict[b] = (m, )
else:
b = 0
bdict[0] = (bdict[0][-1], m) # Chai Wah Wu, Nov 06 2022
CROSSREFS
Sequence in context: A054974 A072481 A032471 * A156222 A002886 A028724
KEYWORD
nonn,base
AUTHOR
Michael De Vlieger, Nov 05 2022
EXTENSIONS
a(30)-a(34) from Chai Wah Wu, Nov 06 2022
a(35) from Martin Ehrenstein, Nov 07 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 31 20:34 EDT 2024. Contains 374808 sequences. (Running on oeis4.)