OFFSET
1,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
a(p) = p-2, for p prime; that is all numbers between 2 and p-1 inclusive. - Michel Marcus, May 31 2014
a(n) = n - A010846(n). - Anthony Browne, Jun 07 2016
EXAMPLE
For n=5, the three numbers 2,3 and 4 have a prime factor that is not found in 5. Hence a(5) = 3.
MATHEMATICA
Table[Sum[1-Floor[n^k/k]+Floor[(n^k-1)/k], {k, n}], {n, 100}] (* Anthony Browne, Jun 07 2016 *)
PROG
(PARI) a(n) = {pfn = factor(n)[, 1]~; nb = 0; for (i=2, n, pfi = factor(i)[, 1]~; for (j=1, #pfi, if (! vecsearch(pfn, pfi[j]), nb++; break); ); ); nb; } \\ Michel Marcus, May 31 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved