OFFSET
1,3
LINKS
Katarzyna Matylla, Table of n, a(n) for n = 1..1000
EXAMPLE
12 = 2^2 * 3^1, So the exponents in the prime-factorization of 12 are 1 and 2. There are 4 terms that equal 1 among the first 11 terms of the sequence. (Those terms are a(1), a(2), a(4), a(9)). There is one term (a(3)) that equals 2. So a(12) = 4+1 = 5.
14 = 2^1 * 7^1. So the only distinct exponent in the prime-factorization of 14 is 1. There are 4 terms from among the first 13 terms of the sequence that equal 1. So a(14) = 4.
MATHEMATICA
f[l_List] :=Append[l, Length @Select[l, MemberQ[Last /@ FactorInteger[Length[l] + 1], # ] &]]; Nest[f, {1}, 100] (* Ray Chandler, Nov 21 2006 *)
PROG
(Maxima) /* program from Katarzyna Matylla, Feb 19 2008: Variable max = how much terms we need. Generating 1000 terms took a few hours: */
"|"(a, b):= if b=0 then true else if a=0 then false else if (floor(b/a))=(b/a) then true else false;
max:1000;
infix("|");
deg(n, p):=if p<2 then 0 else block(d:0, loop, if ((p^(d+1))|n) then d:d+1 else go(end), go(loop), end, d);
f:makelist(0, i, 1, max);
dg:makelist(0, i, 1, max);
f[1]:1;
for n:2 through max do block(for i:2 through n do dg[i]:deg(n, i), k:0, loop1, k:k+1, p:2, loop, if (f[k]=dg[p]) then block(f[n]:f[n]+1, p:n+1), if (p<=n) then p:next_prime(p), if (p<=n) then go(loop), if k<(n-1) then go(loop1));
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 19 2006
EXTENSIONS
Extended by Ray Chandler, Nov 21 2006
STATUS
approved