%I #16 Jan 01 2024 07:59:19
%S 1,1,2,1,2,2,1,1,2,2,2,2,1,1,3,1,1,2,1,2,3,2,1,2,2,1,2,1,1,3,1,1,3,1,
%T 2,2,1,1,2,2,1,3,2,2,3,1,1,2,1,2,2,1,1,2,3,1,2,1,1,3,1,1,3,1,2,3,1,1,
%U 2,2,1,2,1,1,3,1,2,2,1,2,2,1,1,3,3,2,2,2,1,3,1,1,2,1,2,2,1,1,3,2,1,2,1,1,4
%N a(n) is the number of Jacobsthal numbers dividing n.
%H Antti Karttunen, <a href="/A293431/b293431.txt">Table of n, a(n) for n = 1..21845</a>
%F a(n) = Sum_{d|n} A147612(d).
%F a(n) = A293433(n) + A147612(n).
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{n>=2} 1/A001045(n) = 1.718591611927... . - _Amiram Eldar_, Jan 01 2024
%e For n = 15, whose divisors are [1, 3, 5, 15], the first three, 1, 3 and 5 are all in A001045, thus a(15) = 3.
%e For n = 21, whose divisors are [1, 3, 7, 21], 1, 3 and 21 are in A001045, thus a(21) = 3.
%e For n = 105, whose divisors are [1, 3, 5, 7, 15, 21, 35, 105], only the divisors 1, 3, 5 and 21 are in A001045, thus a(105) = 4.
%t With[{s = LinearRecurrence[{1, 2}, {0, 1}, 24]}, Array[DivisorSum[#, 1 &, MemberQ[s, #] &] &, 105]] (* _Michael De Vlieger_, Oct 09 2017 *)
%o (PARI)
%o A147612aux(n,i) = if(!(n%2),n,A147612aux((n+i)/2,-i));
%o A147612(n) = 0^(A147612aux(n,1)*A147612aux(n,-1));
%o A293431(n) = sumdiv(n,d,A147612(d));
%Y Cf. A000005, A001045, A147612, A293432, A293433.
%Y Cf. also A005086.
%K nonn
%O 1,3
%A _Antti Karttunen_, Oct 09 2017