OFFSET
2,3
COMMENTS
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.
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
FORMULA
a(p)=1 where p is a prime.
If p is a prime, a(p^k) = k*((p^k-1)/(p-1) - (k-1)/2). - Robert Israel, Dec 01 2016
EXAMPLE
2 = 2_1, thus a(2)=1.
3 = 3_1, thus a(3)=1.
4 = 2_2 * 2_3, thus a(4)=5.
5 = 5_1, thus a(5)=1.
6 = 2_4 * 3_2, thus a(6)=6.
7 = 7_1, thus a(7)=1.
8 = 2_5 * 2_6 * 2_7, thus a(8) = 5 + 6 + 7 = 18, etc.
MAPLE
for n from 2 to 100 do
F:= ifactors(n)[2];
t:= 0;
for f in F do
if not assigned(R[f[1]]) then R[f[1]]:= 0 fi;
t:= t + R[f[1]]*f[2] + f[2]*(f[2]+1)/2;
R[f[1]]:= R[f[1]]+f[2];
od;
A[n]:= t;
od:
seq(A[i], i=2..100); # Robert Israel, Dec 01 2016
MATHEMATICA
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}]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Andrew S. Plewe, Aug 10 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, Aug 10 2004
STATUS
approved