A125088 a(1)=1. a(n) = sum of the earlier terms equal to any exponent in the prime-factorization of n.
1, 1, 2, 2, 2, 2, 2, 0, 10, 2, 2, 16, 2, 2, 2, 0, 2, 24, 2, 26, 2, 2, 2, 2, 32, 2, 0, 36, 2, 2, 2, 0, 2, 2, 2, 46, 2, 2, 2, 2, 2, 2, 2, 62, 62, 2, 2, 2, 66, 68, 2, 70, 2, 2, 2, 2, 2, 2, 2, 84, 2, 2, 88, 0, 2, 2, 2, 94, 2, 2, 2, 98, 2, 2, 104, 104, 2, 2, 2, 2, 0, 2, 2, 116, 2, 2, 2, 2, 2, 126, 2, 128
Offset: 1
Keywords
Examples
12 has a prime factorization of 2^2 *3^1. So a(12) is the sum of the terms among the first 11 terms of the sequence which equal 1 or 2. There are seven 2's and two 1's among the first 11 terms; so a(12) = 1+1+2+2+2+2+2+2+2 = 16.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Crossrefs
Cf. A125087.
Programs
-
Mathematica
f[l_List] := Append[l, Plus @@ Select[l, MemberQ[Last /@ FactorInteger[Length[l] + 1], # ] &]];Nest[f, {1}, 91] (* Ray Chandler, Nov 21 2006 *) a[1] = 1; a[n_] := a[n] = Plus @@ Flatten[ Cases[ Array[a, n - 1], # ] & /@ Union@ Last@ Transpose@ FactorInteger@n]; Array[a, 92] (* Robert G. Wilson v, Nov 22 2006 *)
-
PARI
up_to = 105; A125088list(up_to) = { my(v=vector(up_to)); v[1] = 1; for(n=2,up_to,my(es = vecsort(factor(n)[,2],,8)); v[n] = sum(k=1,n-1,v[k]*!!vecsearch(es,v[k]))); (v); }; v125088 = A125088list(up_to); A125088(n) = v125088[n]; \\ Antti Karttunen, Apr 01 2021
Extensions
Extended by Ray Chandler, Nov 21 2006
Comments