login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A225939 Numbers k that divide prime(k) + prime(k-1). 1

%I #26 Mar 18 2024 12:05:23

%S 4,6,13,14,15,74,190,688,690,6456,40082,251735,251736,251738,399916,

%T 637325,637326,637342,637343,2582372,2582434,4124456,4124458,6592686,

%U 10553425,10553433,10553818,27067038,27067053,43435902,69709872,69709877,69709945,69709954,179992917

%N Numbers k that divide prime(k) + prime(k-1).

%H Giovanni Resta, <a href="/A225939/b225939.txt">Table of n, a(n) for n = 1..58</a> (terms < 1.5*10^12)

%e prime(3) + prime(4) = 5+7 = 12, because 12 is divisible by 4, the latter is in the sequence.

%e prime(5) + prime(6) = 11+13 = 24, because 24 is divisible by 6, the latter is in the sequence.

%t Select[Range[2,10^4],Divisible[Prime@#+Prime[#-1],#]&] (* _Giorgos Kalogeropoulos_, Aug 20 2021 *)

%o (C)

%o #include <stdio.h>

%o #define TOP (1ULL<<32)

%o int main() {

%o unsigned long long i, j, n = 1, prev;

%o char *c = (char*)malloc(TOP/2);

%o memset(c, 0, TOP/2);

%o for (prev = 2, i = 3; i < TOP; i += 2)

%o if (c[i>>1]==0) {

%o if ((i+prev) % ++n == 0) printf("%llu, ", n);

%o for (prev = i, j = i*i>>1; j < TOP/2; j += i) c[j] = 1;

%o }

%o return 0;

%o }

%o (Sage)

%o def is_a(n): return (nth_prime(n) + nth_prime(n-1)) % n == 0

%o filter(is_a, (2..1000)) # _Peter Luschny_, May 22 2013

%Y Cf. A001043, A023143, A045924, A066895, A066896.

%K nonn

%O 1,1

%A _Alex Ratushnyak_, May 21 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 13 07:05 EDT 2024. Contains 374267 sequences. (Running on oeis4.)