A325804 Positions of nonzero terms of Product_{k=0..floor(log_2(n))} (1 + A004718(floor(n/(2^k)))).
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
Keywords
Links
- Mikhail Kurkov, Table of n, a(n) for n = 1..13495
Programs
-
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 *)
-
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
Formula
Conjecture: a(n) - a(n-1) belongs to A094373. - Mikhail Kurkov, Feb 20 2021