%I #35 Sep 28 2023 04:25:02
%S 1,1,1,2,1,2,1,1,2,2,1,3,1,2,2,2,1,3,1,3,2,2,1,2,2,2,1,3,1,3,1,3,2,2,
%T 2,4,1,2,2,2,1,3,1,3,3,2,1,3,2,3,2,3,1,2,2,2,2,2,1,4,1,2,3,2,2,3,1,3,
%U 2,3,1,3,1,2,3,3,2,3,1,3,2,2,1,4,2,2,2,2,1,4,2,3,2,2,2,4,1,3,3,4,1,3,1,2,3
%N Number of factors needed in the unique factorization of positive integers into terms of A186285 where any term is used at most twice.
%C The number 1 with factorization defined to be 1 has been included. See a comment on A240230.
%C This is the row length sequence for the table A240230.
%C a(n) = 1 if and only if n = 1 or n is a term of A186285.
%H Antti Karttunen, <a href="/A240231/b240231.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>.
%F a(n) is, for n >= 2, the sum of all entries in the base 3 representation of the exponents of the primes in the usual prime number factorization of n.
%F From _Antti Karttunen_, Aug 12 2017: (Start)
%F That is, apart from the initial term, additive with a(p^e) = A053735(e).
%F Define b(1) = 0; and for n > 1, b(n) = A053735(A067029(n)) + b(A028234(n)). Then a(n) = b(n) for n > 1, with a(1) = 1 by convention.
%F (End)
%F Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B + C), where B is Mertens's constant (A077761) and C = Sum_{p prime} f(1/p) = 0.38090372984518844518..., where f(x) = -x + Sum_{k>=0} (x^(3^k) + 2*x^(2*3^k))/(1 + x^(3^k) + x^(2*3^k)). - _Amiram Eldar_, Sep 28 2023
%e a(12) = 3 because the usual prime factorization is 12 = 2^2*3^1 and (2)_3 = [2] and (1)_3 = [1], hence the sum of the base-3 representations of the exponents is 3.
%e a(24) = 2 as 24 = 3*8, using two factors from A186285. Note also how 3*8 = 3^1 * 2^3, and ternary representations of 1 and 3 are "1" and "10", thus their digit sum is 2. - _Antti Karttunen_, Aug 12 2017
%e a(36) = 4 from 2^2*3^2, (2)_3 = [2] and 2 + 2 = 4.
%t Block[{nn = 105, s}, s = Select[Select[Range@ nn, PrimePowerQ], IntegerQ@ Log[3, FactorInteger[#][[1, -1]]] &]; {1}~Join~Table[Length@ Rest@ NestWhileList[Function[{k, m}, {k/#, #} &@ SelectFirst[Reverse@ TakeWhile[s, # <= k &], Divisible[k, #] &]] @@ # &, {n, 1}, First@ # > 1 &][[All, -1]], {n, 2, nn}]] (* _Michael De Vlieger_, Aug 14 2017 *)
%t a[n_] := Total[Plus @@ IntegerDigits[#, 3] & /@ (FactorInteger[n][[;; , 2]])]; Array[a, 100] (* _Amiram Eldar_, May 18 2023 *)
%o (Scheme)
%o (define (A240231 n) (if (= 1 n) n (A240231with_a1_0 n)))
%o (definec (A240231with_a1_0 n) (if (= 1 n) 0 (+ (A053735 (A067029 n)) (A240231with_a1_0 (A028234 n)))))
%o ;; _Antti Karttunen_, Aug 12 2017
%Y Cf. A053735, A077761,A186285, A240230.
%K nonn,easy
%O 1,4
%A _Wolfdieter Lang_, May 15 2014
%E Description clarified and more terms added by _Antti Karttunen_, Aug 12 2017