OFFSET
1,4
LINKS
EXAMPLE
The 10th prime is 29. Checking: 29-2=27 is divisible by 10-1=9. 29-3=26 is not divisible by 10-2=8. 29-5=24 is not divisible by 10-3=7. 29-7=22 is not divisible by 10-4=6. 29-11=18 is not divisible by 10-5=5. 29-13=16 is divisible by 10-6=4. 29-17=12 is divisible by 10-7=3. 29-19=10 is divisible by 10-8=2. And 29-23=6 is divisible by 10-9=1. There are therefore five k's where prime(10)-prime(k) is divisible by 10-k. So a(10)=5.
MAPLE
a := proc (n) local ct, k: ct := 0: for k to n-1 do if `mod`(ithprime(n)-ithprime(k), n-k) = 0 then ct := ct+1 else end if end do: ct end proc: seq(a(n), n = 1 .. 100); # Emeric Deutsch, Jul 30 2009
A163001 := proc(n) local a, k ; a := 0 ; for k from 1 to n-1 do if ( ithprime(n)-ithprime(k) ) mod (n-k) = 0 then a := a+1; fi; od: a ; end ; seq(A163001(n), n=1..120) ; # R. J. Mathar, Jul 30 2009
PROG
(PARI) a(n) = sum(k=1, n-1, ! ((prime(n)-prime(k)) % (n-k))); \\ Michel Marcus, Aug 18 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 20 2009
EXTENSIONS
Extended by Emeric Deutsch and R. J. Mathar, Jul 30 2009
STATUS
approved