login
A141829
a(n) = the number of positive divisors of (p(n)-1) that are each <= p(n+1)-p(n), where p(n) is the n-th prime.
3
1, 2, 2, 3, 2, 4, 2, 3, 2, 2, 5, 4, 2, 3, 2, 3, 2, 6, 3, 2, 5, 3, 2, 4, 4, 2, 3, 2, 4, 6, 3, 3, 2, 4, 2, 5, 5, 3, 2, 3, 2, 8, 2, 4, 2, 6, 7, 3, 2, 4, 3, 2, 8, 3, 3, 2, 2, 5, 4, 2, 4, 3, 3, 2, 4, 3, 5, 7, 2, 4, 3, 2, 4, 5, 3, 2, 3, 4, 5, 6, 2, 8, 2, 5, 3, 2, 5, 4, 2, 3, 2, 2, 3, 4, 3, 2, 3, 2, 6, 6, 5, 3, 2, 2, 5
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
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
Sequence in context: A369306 A038148 A366742 * A111336 A083902 A205562
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 09 2008
EXTENSIONS
Extended beyond a(17) by R. J. Mathar, Aug 08 2008
STATUS
approved