login
Number of distinct prime factors of n-th triangular number.
7

%I #14 Sep 21 2024 07:27:26

%S 0,1,2,2,2,2,2,2,2,2,3,3,2,3,3,2,2,2,3,4,3,2,3,3,2,2,3,3,3,3,2,3,3,3,

%T 4,3,2,3,4,3,3,3,3,4,3,2,3,3,2,3,4,3,2,3,4,4,3,2,4,4,2,3,3,3,4,3,3,4,

%U 4,3,3,3,2,3,4,4,4,3,3,3,2,2,4,5,3,3,4,3,3,4

%N Number of distinct prime factors of n-th triangular number.

%H Harvey P. Dale, <a href="/A069903/b069903.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A001221(A000217(n)).

%F Sum_{k=1..n} a(k) = 2 * n * (log(log(n)) + B - 1/4) + O(n/log(n)), where B is Mertens's constant (A077761). - _Amiram Eldar_, Sep 21 2024

%e A000217(11) = 11*(11+1)/2 = 66 = 2*3*11, therefore a(11) = 3.

%t PrimeNu[#]&/@Accumulate[Range[90]] (* _Harvey P. Dale_, Oct 06 2016 *)

%o (PARI) a(n) = omega(n*(n+1)/2); \\ _Michel Marcus_, Feb 05 2021

%o (PARI) a(n)=onega(n/gcd(n,2))+omega((n+1)/gcd(n+1)) \\ _Charles R Greathouse IV_, Sep 21 2024

%Y Cf. A000217, A001221, A059957, A069901, A069902, A069904, A077761.

%K nonn,easy

%O 1,3

%A _Reinhard Zumkeller_, Apr 10 2002