OFFSET
0,3
COMMENTS
LINKS
FORMULA
MATHEMATICA
nn = 65; b = MixedRadix[Reverse@ Prime@ Range[IntegerLength[nn, 2] - 1]]; Table[FromDigits[IntegerDigits[n, 2], b], {n, 0, 65}] (* Version 10.2, or *)
Table[Total[Times @@@ Transpose@ {Map[Times @@ # &, Prime@ Range@ Range[0, Length@ # - 1]], Reverse@ #}] &@ IntegerDigits[n, 2], {n, 0, 65}] (* Michael De Vlieger, Aug 26 2016 *)
PROG
(Scheme, two versions)
;; Almost standalone, requiring only A000040:
(define (A276156 n) (let loop ((n n) (s 0) (pr 1) (i 1)) (cond ((zero? n) s) ((even? n) (loop (/ n 2) s (* (A000040 i) pr) (+ 1 i))) (else (loop (/ (- n 1) 2) (+ s pr) (* (A000040 i) pr) (+ 1 i))))))
;; One using memoization-macro, implementing the given recurrence:
(definec (A276156 n) (cond ((zero? n) n) ((even? n) (A276154 (A276156 (/ n 2)))) (else (+ 1 (A276154 (A276156 (/ (- n 1) 2)))))))
(Python)
from sympy import prime, primorial, primepi, factorint
from operator import mul
def a002110(n): return 1 if n<1 else primorial(n)
def a276085(n):
f=factorint(n)
return sum([f[i]*a002110(primepi(i) - 1) for i in f])
def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) # after Chai Wah Wu
def a(n): return 0 if n==0 else a276085(a019565(n))
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 23 2017
(PARI) A276156(n) = { my(s=0, p=1, r=1); while(n, if(n%2, s += r); n>>=1; p = nextprime(1+p); r *= p); (s); }; \\ Antti Karttunen, Feb 03 2022
CROSSREFS
Cf. A000040, A001511, A002110, A007088, A007814, A019565, A049345, A257993, A276084, A276085, A276154, A351073, A328461, A328473, A328474, A328571, A328831, A328836, A341518, A344591.
Complement of A177711.
Fixed points of A328841, positions of zeros in A328828, A328842, and A329032, positions of ones in A328581, A328582, and A381032.
Positions of terms < 2 in A328114.
Cf. also table A328464 (and its rows).
KEYWORD
nonn,base,changed
AUTHOR
Antti Karttunen, Aug 24 2016
STATUS
approved