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!)
A354680 Terms of A354169 that are not powers of 2, in order of appearance. 10

%I #53 Nov 29 2023 13:08:01

%S 0,3,12,17,34,68,136,768,1025,18,2080,12288,16388,72,32896,196608,

%T 262400,524800,1048577,2098176,4194306,48,8390656,50331648,67112960,

%U 134225920,268435460,536887296,1073741832,192,2147516416,12884901888,17179934720,34359869440

%N Terms of A354169 that are not powers of 2, in order of appearance.

%C Apart from the initial 0, all terms have Hamming weight 2. See De Vlieger et al. (2022). - _N. J. A. Sloane_, Aug 29 2022

%H Rémy Sigrist, <a href="/A354680/b354680.txt">Table of n, a(n) for n = 1..3320</a>

%H Michael De Vlieger, Thomas Scheuerle, Rémy Sigrist, N. J. A. Sloane, and Walter Trump, <a href="http://arxiv.org/abs/2209.04108">The Binary Two-Up Sequence</a>, arXiv:2209.04108 [math.CO], Sep 11 2022.

%H Rémy Sigrist, <a href="/A354680/a354680.gp.txt">PARI program</a>

%H Rémy Sigrist, <a href="/A354680/a354680_1.gp.txt">PARI program (optimized version)</a>

%F A000120(A354169(a(n))) <> 1.

%e The initial terms of A354169 are:

%e 0, 1, 2, 4, 8, 3, 16, 32, 64, 12, 128, 256.

%e The initial terms of this sequence are therefore: 0, 3, 12.

%e and the initial terms of A354798 are

%e 0, 5, 9.

%o (PARI) See Links section.

%o (Python 3.10+)

%o from itertools import count, islice

%o from collections import deque

%o from functools import reduce

%o from operator import or_

%o def A354680_gen(): # generator of terms

%o aset, aqueue, b, f = {0,1,2}, deque([2]), 2, False

%o yield 0

%o while True:

%o for k in count(1):

%o m, j, j2, r, s = 0, 0, 1, b, k

%o while r > 0:

%o r, q = divmod(r,2)

%o if not q:

%o s, y = divmod(s,2)

%o m += y*j2

%o j += 1

%o j2 *= 2

%o if s > 0:

%o m += s*2**b.bit_length()

%o if m not in aset:

%o if m.bit_count() > 1:

%o yield m

%o aset.add(m)

%o aqueue.append(m)

%o if f: aqueue.popleft()

%o b = reduce(or_,aqueue)

%o f = not f

%o break

%o A354680_list = list(islice(A354680_gen(),40)) # _Chai Wah Wu_, Jun 06 2022

%Y Cf. A000120, A057716, A354169, A354798 (corresponding indices).

%Y See also A354767.

%K nonn,base

%O 1,2

%A _Rémy Sigrist_ and _N. J. A. Sloane_, Jun 06 2022

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 3 09:27 EDT 2024. Contains 373971 sequences. (Running on oeis4.)