[go: up one dir, main page]

login
Sum of index values of the prime factors (with multiplicity) of n.
1

%I #14 Sep 24 2018 16:53:14

%S 1,1,5,1,6,1,18,7,10,1,24,1,13,9,54,1,31,1,39,12,21,1,73,11,25,36,53,

%T 1,47,1,145,18,34,13,100,1,37,21,120,1,64,1,85,51,44,1,200,15,70,26,

%U 101,1,125,18,165,30,56,1,153,1,59,69,363,20,101,1,135,35,94,1,274,1,73,70

%N Sum of index values of the prime factors (with multiplicity) of n.

%C Let P be equal to the set of prime factors of the positive integers, counted with multiplicity. Order the members of this set into subsets such that each prime has its own set with an index value assigned to each instance of the prime. Therefore P = {{2_1, 2_2,..2_i}, {3_1, 3_2,..3_j}, . . {p_1, p_2,..p_x}}. In generating the sequence, each indexed instance of a prime can only be used once.

%H Robert Israel, <a href="/A096462/b096462.txt">Table of n, a(n) for n = 2..10000</a>

%F a(p)=1 where p is a prime.

%F If p is a prime, a(p^k) = k*((p^k-1)/(p-1) - (k-1)/2). - _Robert Israel_, Dec 01 2016

%e 2 = 2_1, thus a(2)=1.

%e 3 = 3_1, thus a(3)=1.

%e 4 = 2_2 * 2_3, thus a(4)=5.

%e 5 = 5_1, thus a(5)=1.

%e 6 = 2_4 * 3_2, thus a(6)=6.

%e 7 = 7_1, thus a(7)=1.

%e 8 = 2_5 * 2_6 * 2_7, thus a(8) = 5 + 6 + 7 = 18, etc.

%p for n from 2 to 100 do

%p F:= ifactors(n)[2];

%p t:= 0;

%p for f in F do

%p if not assigned(R[f[1]]) then R[f[1]]:= 0 fi;

%p t:= t + R[f[1]]*f[2] + f[2]*(f[2]+1)/2;

%p R[f[1]]:= R[f[1]]+f[2];

%p od;

%p A[n]:= t;

%p od:

%p seq(A[i],i=2..100); # _Robert Israel_, Dec 01 2016

%t PrimeFactors[n_Integer] := Flatten[ Table[ # [[1]], {1}] & /@ FactorInteger[n]]; f[n_, p_] := Block[{t = 0, q = p}, While[s = Floor[n/q]; t = t + s; s > 0, q *= p]; t]; g[n_] := Block[{s = 0, pf = PrimeFactors[n], k = 1}, l = Length[pf]; While[k <= l, s = s + Sum[i, {i, f[n - 1, pf[[k]]] + 1, f[n, pf[[k]]]}]; k++ ]; s]; Table[g[n], {n, 2, 75}]

%K nonn,look

%O 2,3

%A _Andrew S. Plewe_, Aug 10 2004

%E Edited and extended by _Robert G. Wilson v_, Aug 10 2004