OFFSET
1,2
COMMENTS
a(n) also equals the number of positive integers k, k <= p(n+1)-p(k), that divide (p(n)+k-1).
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
The 16th prime is 53 and the 17th prime is 59. So the divisors of 53-1=52 that are <= 59-53=6 are 1,2,4. There are three such divisors.
Also, 53 is divisible by 1. 54 is divisible by 2. 55 is not divisible by 3. 56 is divisible by 4. 57 is not divisible by 5. And 58 is not divisible 6. So in the span of integers p(16)=53 to p(17)-1=58, there are 3 integers k where k divides (p(16)+k-1). So a(16) = 3.
MAPLE
A141829 := proc(n) local p, q, a, d ; p := ithprime(n) ; q := nextprime(p) ; a := 0 ; for d in numtheory[divisors](p-1) do if d <= q-p then a :=a+1 ; fi; od: RETURN(a) ; end: for n from 1 to 200 do printf("%a, ", A141829(n)) ; od: # R. J. Mathar, Aug 08 2008
MATHEMATICA
Table[Function[{p, q}, DivisorSum[p - 1, 1 &, # <= q - p &]] @@ {Prime@ n, Prime[n + 1]}, {n, 105}] (* Michael De Vlieger, Oct 25 2017 *)
PROG
(PARI) a(n) = #select(x->(x <= prime(n+1)-prime(n)), divisors(prime(n)-1)); \\ Michel Marcus, Oct 26 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 09 2008
EXTENSIONS
Extended beyond a(17) by R. J. Mathar, Aug 08 2008
STATUS
approved