login
A325803
Nonzero terms of Product_{k=0..floor(log_2(n))} (1 + A004718(floor(n/(2^k)))).
3
1, 2, 6, -6, 24, -18, -48, 120, 18, -72, -192, 48, -360, 720, 54, 144, -360, 384, -960, 144, -1800, 720, -2880, 5040, -54, 216, 576, -144, 1080, -2160, 1536, -384, 2880, -5760, -144, 576, 5400, -10800, 2880, -720, -17280, 8640, -25200, 40320, -162, -432, 1080
OFFSET
1,2
COMMENTS
See A329893.
LINKS
FORMULA
a(n) = A329893(A325804(n)). - Antti Karttunen, Dec 10 2019
MATHEMATICA
a[n_?EvenQ] := a[n] = -a[n/2]; a[0] = 0; a[n_] := a[n] = a[(n - 1)/2] + 1; DeleteCases[Table[Product[ 1 + a[Floor[n/(2^k)]], {k, 0, Floor[Log2[n]]}], {n, 0, 200}], 0] (* 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)));
lista(nn) = for (n=0, nn, if (f(n), print1(f(n), ", "))); \\ Michel Marcus, May 26 2019
(Python)
from itertools import count, islice
from math import prod
def A325803_gen(): # generator of terms
for n in count(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 (k:=prod(1+d for d in c)): yield k
A325803_list = list(islice(A325803_gen(), 20)) # Chai Wah Wu, Mar 03 2023
CROSSREFS
KEYWORD
sign,look
AUTHOR
Mikhail Kurkov, May 22 2019
EXTENSIONS
Comments and two formulas moved to A329893, which is an "uncompressed" version of this sequence. - Antti Karttunen, Dec 11 2019
STATUS
approved