OFFSET
1,1
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..58 (terms < 1.5*10^12)
EXAMPLE
prime(3) + prime(4) = 5+7 = 12, because 12 is divisible by 4, the latter is in the sequence.
prime(5) + prime(6) = 11+13 = 24, because 24 is divisible by 6, the latter is in the sequence.
MATHEMATICA
Select[Range[2, 10^4], Divisible[Prime@#+Prime[#-1], #]&] (* Giorgos Kalogeropoulos, Aug 20 2021 *)
PROG
(C)
#include <stdio.h>
#define TOP (1ULL<<32)
int main() {
unsigned long long i, j, n = 1, prev;
char *c = (char*)malloc(TOP/2);
memset(c, 0, TOP/2);
for (prev = 2, i = 3; i < TOP; i += 2)
if (c[i>>1]==0) {
if ((i+prev) % ++n == 0) printf("%llu, ", n);
for (prev = i, j = i*i>>1; j < TOP/2; j += i) c[j] = 1;
}
return 0;
}
(Sage)
def is_a(n): return (nth_prime(n) + nth_prime(n-1)) % n == 0
filter(is_a, (2..1000)) # Peter Luschny, May 22 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, May 21 2013
STATUS
approved