OFFSET

1,2

COMMENTS

The prime graph is defined to be the graph formed by writing the integers 0 to n in a straight line as vertices and then connecting i and j (i > j) iff i-j=1 or i=j+p, where p is a prime factor of i. It can be visualized as the Sieve of Eratosthenes, with each integer connected to its neighbors and the striking out process as a wave forming the remaining edges.

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..2000

FORMULA

a(n) = a(n-1) + 1 + omega(n) if n > 1, with a(1) = 1, where omega(n) is the number of distinct prime factors of n.

a(n) = Sum_{p is 1 or a prime, p <= n} floor(n/p); e.g., a(12) = floor(12/1) + floor(12/2) + floor(12/30) + floor(12/5) + floor(12/7) + floor(12/11) = 12 + 6 + 4 + 2 + 1 + 1 = 26. - Amarnath Murthy, Jul 06 2005

EXAMPLE

a(1) = 1.

a(2) = a(1) + 1 + omega(2) = 1 + 1 + 1 = 3.

a(6) = a(5) + 1 + omega(6) = 9 + 1 + 2 = 12.

MATHEMATICA

Accumulate[PrimeNu[Range[120]] + 1] (* Vincenzo Librandi, Jun 10 2017 *)

PROG

(PARI) a=1; c=2; while (c<50, print1(a", "); a=a+1+omega(c); c++)

(Magma) I:=[1]; [n le 1 select I[n] else Self(n-1)+1+#PrimeDivisors(n): n in [1..70]]; // Vincenzo Librandi, Jun 10 2017

CROSSREFS

KEYWORD

nonn

AUTHOR

Jon Perry, May 24 2003

EXTENSIONS

Corrected by T. D. Noe, Oct 25 2006

STATUS

approved