login
Multiplicative with a(p^e) = 2^A002487(e).
6

%I #20 May 19 2023 01:48:40

%S 1,2,2,2,2,4,2,4,2,4,2,4,2,4,4,2,2,4,2,4,4,4,2,8,2,4,4,4,2,8,2,8,4,4,

%T 4,4,2,4,4,8,2,8,2,4,4,4,2,4,2,4,4,4,2,8,4,8,4,4,2,8,2,4,4,4,4,8,2,4,

%U 4,8,2,8,2,4,4,4,4,8,2,4,2,4,2,8,4,4,4,8,2,8,4,4,4,4,4,16,2,4,4,4,2,8,2,8,8

%N Multiplicative with a(p^e) = 2^A002487(e).

%H Antti Karttunen, <a href="/A318307/b318307.txt">Table of n, a(n) for n = 1..16384</a>

%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>

%F a(n) = 2^A318306(n).

%F a(n) = A061142(A318470(n)).

%F a(n^2) = a(n).

%F a(A003557(n^2)) = A318316(n).

%F Dirichlet convolution square of A318667(n)/A317934(n).

%t f[m_] := Module[{a = 1, b = 0, n = m}, While[n > 0, If[OddQ[n], b += a, a += b]; n = Floor[n/2]]; b]; Array[Times @@ Map[2^f@ # &, FactorInteger[#][[All, -1]] ] - Boole[# == 1] &, 105] (* after _Jean-François Alcover_ at A002487 *)

%o (PARI)

%o A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487

%o A318307(n) = factorback(apply(e -> 2^A002487(e),factor(n)[,2]));

%o (Python)

%o from functools import reduce

%o from sympy import factorint

%o def A318307(n): return 1<<sum(sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(e)[-1:2:-1],(1,0))) for e in factorint(n).values()) # _Chai Wah Wu_, May 18 2023

%Y Cf. A318306, A318316, A318470, A318667.

%Y Differs from A037445 for the first time at n=32, where a(32) = 8, while A037445(32) = 4.

%K nonn,mult

%O 1,2

%A _Antti Karttunen_, Aug 29 2018