OFFSET
1,2
COMMENTS
Sum of the terms in the prime index chain for n (cf. A049076).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
N. Fernandez, An order of primeness, F(p)
N. Fernandez, An order of primeness [cached copy, included with permission of the author]
EXAMPLE
a(2) = 3 because 2 is the first prime, therefore 2 + 1 = 3. a(3) = 6 because 3 is the second prime and two is the first prime, therefore 3 + 2 + 1 = 6. a(4) = 4 because 4 is composite. a(5) = 11 because five is the third prime, three is the second prime and two is the first prime, which gives us 5 + 3 + 2 + 1 = 11 and so on.
MAPLE
a:= n-> n + `if`(isprime(n), a(numtheory[pi](n)), 0):
seq (a(n), n=1..80); # Alois P. Heinz, Jul 16 2012
MATHEMATICA
Table[s=n; p=n; While[PrimeQ[p], p=PrimePi[p]; s=s+p]; s, {n, 1000}] (T. D. Noe)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Andrew S. Plewe, Oct 26 2004
EXTENSIONS
More terms from Ray Chandler, Nov 04 2004
STATUS
approved