login
A325804
Positions of nonzero terms of Product_{k=0..floor(log_2(n))} (1 + A004718(floor(n/(2^k)))).
3
0, 1, 3, 6, 7, 12, 14, 15, 24, 25, 28, 29, 30, 31, 48, 50, 51, 56, 57, 58, 60, 61, 62, 63, 96, 97, 100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, 127, 192, 194, 195, 200, 201, 202, 204, 205, 206, 207, 224, 225, 226, 228
OFFSET
1,3
LINKS
FORMULA
Conjecture: a(n) - a(n-1) belongs to A094373. - Mikhail Kurkov, Feb 20 2021
MATHEMATICA
a[n_?EvenQ] := a[n] = -a[n/2]; a[0] = 0; a[n_] := a[n] = a[(n - 1)/2] + 1; -1 + Position[Table[Product[ 1 + a[Floor[n/(2^k)]], {k, 0, Floor[Log2[n]]}], {n, 0, 500}], _?(# != 0 &)][[All, 1]] (* Michael De Vlieger, Apr 22 2024, after Jean-François Alcover at A004718 *)
PROG
(PARI) b(n) = if(n==0, 0, (-1)^(n+1)*b(n\2) + n%2); \\ A004718
f(n) = if(n==0, 1, prod(k=0, logint(n, 2), 1+b(n\2^k)));
isok(n) = f(n)!=0; \\ Michel Marcus, May 24 2019
(Python)
from itertools import count, islice
def A325804_gen(startvalue=0): # generator of terms >= startvalue
for n in count(max(startvalue, 0)):
c, s = [0]*(m:=n.bit_length()), bin(n)[2:]
for i in range(m):
if s[i]=='1':
for j in range(m-i):
c[j] = c[j]+1
else:
for j in range(m-i):
c[j] = -c[j]
if all(1+d for d in c): yield n
A325804_list = list(islice(A325804_gen(), 20)) # Chai Wah Wu, Mar 03 2023
CROSSREFS
Sequence in context: A138038 A095029 A028792 * A144795 A364292 A077459
KEYWORD
nonn
AUTHOR
Mikhail Kurkov, May 22 2019
STATUS
approved