A096111 If n = 2^k - 1, then a(n) = k+1, otherwise a(n) = (A000523(n)+1)*a(A053645(n)).
1, 2, 2, 3, 3, 6, 6, 4, 4, 8, 8, 12, 12, 24, 24, 5, 5, 10, 10, 15, 15, 30, 30, 20, 20, 40, 40, 60, 60, 120, 120, 6, 6, 12, 12, 18, 18, 36, 36, 24, 24, 48, 48, 72, 72, 144, 144, 30, 30, 60, 60, 90, 90, 180, 180, 120, 120, 240, 240, 360, 360, 720, 720, 7, 7, 14, 14, 21, 21
Offset: 0
Keywords
Links
- Peter Kagey, Table of n, a(n) for n = 0..10000
Crossrefs
Programs
-
Maple
f:= proc(n) local L; L:= convert(2*n+2,base,2); convert(subs(0=NULL,zip(`*`,L, [$0..nops(L)-1])),`*`); end proc: map(f, [$0..100]); # Robert Israel, Apr 25 2016
-
Mathematica
CoefficientList[(Product[1 + k x^(2^(k - 1)), {k, 7}] - 1)/x, x] (* Michael De Vlieger, Apr 08 2016 *) bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];Table[Times@@bpe[n+1],{n,0,100}] (* Gus Wiseman, Jul 26 2019 *)
-
PARI
N=166; q='q+O('q^N); gf= (prod(n=1,1+ceil(log(N)/log(2)), 1+n*q^(2^(n-1)) ) - 1) / q; Vec(gf) /* Joerg Arndt, Oct 06 2012 */
-
Scheme
(define (A096111 n) (cond ((pow2? (+ n 1)) (+ 2 (A000523 n))) (else (* (+ 1 (A000523 n)) (A096111 (A053645 n)))))) (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))
Formula
G.f.: ( prod(k>=1, 1+k*x^(2^(k-1)) )- 1 ) / x. - Vladeta Jovovic, Nov 08 2005
a(n) is the product of the exponents in the binary expansion of 2*n + 2. - Peter Kagey, Apr 24 2016
Extensions
Edited, extended and Scheme code added by Antti Karttunen, Aug 25 2006
Comments