A110765 Let n in binary be a k-bit number with bits d_1, d_2, ..., d_k (concatenated). a(n) = 2^d_1 * 3^d_2 * ... * prime(k)^d_k, where prime(k) is the k-th prime.
1, 2, 2, 6, 2, 10, 6, 30, 2, 14, 10, 70, 6, 42, 30, 210, 2, 22, 14, 154, 10, 110, 70, 770, 6, 66, 42, 462, 30, 330, 210, 2310, 2, 26, 22, 286, 14, 182, 154, 2002, 10, 130, 110, 1430, 70, 910, 770, 10010, 6, 78, 66, 858, 42, 546, 462, 6006, 30, 390, 330, 4290, 210, 2730
Offset: 0
Examples
n = 7: binary(7) = 111, and the first three primes are 2, 3, 5, so a(7) = 2^1 * 3^1 * 5^1 = 2*3*5 = 30. n = 10: binary(10) = 1010, so a(10) = 2^1 * 3^0 * 5^1 * 7^0 = 2*1*5*1 = 10.
Links
- Peter Munn, Table of n, a(n) for n = 0..10000 (essentially from Reinhard Zumkeller)
Programs
-
Haskell
a110765 = product . zipWith (^) a000040_list . reverse . a030308_row -- Reinhard Zumkeller, Aug 28 2014
-
Mathematica
Array[Times @@ Prime@ Flatten@ Position[#, 1] &@ IntegerDigits[#, 2] &, 61] (* Michael De Vlieger, Feb 28 2021 *)
-
PARI
a(n)=factorback(Mat(vector(#n=binary(n),j,[prime(j),n[j]])~))
-
PARI
a(n)=prod(j=1,#n=binary(n),prime(j)^n[j]) \\ M. F. Hasler, Mar 25 2011
-
Python
from sympy import prime from operator import mul from functools import reduce def A110765(n): return reduce(mul, (prime(i) for i,d in enumerate(bin(n)[2:],start=1) if int(d))) # Chai Wah Wu, Sep 05 2014
-
Python
# implementation using recursion from sympy import prime def _A110765(n): nlen = len(n) return _A110765(n[:-1])*(prime(nlen) if int(n[-1]) else 1) if nlen > 1 else int(n) + 1 def A110765(n): return _A110765(bin(n)[2:]) # Chai Wah Wu, Sep 05 2014
Formula
a(0) = 1; a(2n) = a(n); a(2n+1) = a(n) * A000040(1+A000523(2n+1)), where A000040(k) is the k-th prime and A000523(k) = floor(log_2(k)) . - Peter Munn, Aug 26 2025
Extensions
More terms from Stacy Hawthorne (shawtho1(AT)ashland.edu), Oct 31 2005
Name edited by Peter Munn, May 28 2025
a(0) prefixed by Peter Munn, Aug 26 2025
Comments