OFFSET
0,2
COMMENTS
As noted by David A. Corneth, the function f(n) = a(n-1) [that is, the offset-1 version of this sequence] seems to be "almost multiplicative". Sequence A324109 gives the positions n where f(n) satisfies the multiplicativity in a sense that f(n) = f(p(1)^e(1)) * ... * f(p(k)^e(k)), when n = p(1)^e(1) * ... * p(k)^e(k), and A324110 the positions where this does not hold.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191
Antti Karttunen, Data supplement: n, a(n) computed for n = 0..70327
Michael De Vlieger, Annotated fan-style binary tree diagram showing 16 levels, where blue represents A336834(n) = 1 and yellow A336834(n) = 0. Labels are a(n) for the 8 smallest levels.
MATHEMATICA
nn = 76; a[0] = 1; Do[Set[a[n], Prime[1 + DigitCount[n, 2, 0]]*a[n - 2^Floor@ Log2@ n]], {n, nn}]; Array[DivisorSigma[1, a[#]] &, nn, 0] (* Michael De Vlieger, Aug 03 2022 *)
PROG
(PARI)
A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
(PARI) A324054(n) = { my(p=2, mp=p*p, m=1); while(n, if(!(n%2), p=nextprime(1+p); mp = p*p, if(3==(n%4), mp *= p, m *= (mp-1)/(p-1))); n>>=1); (m); };
(Python)
from math import prod
from itertools import accumulate
from collections import Counter
from sympy import prime
def A324054(n): return prod(((p:=prime(len(a)+1))**(b+1)-1)//(p-1) for a, b in Counter(accumulate(bin(n)[2:].split('1')[:0:-1])).items()) # Chai Wah Wu, Mar 10 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 14 2019
STATUS
approved