login
Numbers k such that prime(k) == 8 (mod k).
14

%I #27 Feb 11 2021 22:54:24

%S 1,3,17,443,2701,100365,637235,637325,4124455,4124473,4124587,

%T 27067125,27067137,27067521,8179002131,8179002135,8179002153,

%U 55762149069,382465573521,6201265271239145,6201265271240411,43525513764814933,43525513764815131,43525513764816415

%N Numbers k such that prime(k) == 8 (mod k).

%H Giovanni Resta, <a href="/A023150/b023150.txt">Table of n, a(n) for n = 1..30</a>

%t p = 1; Do[ If[ Mod[p = NextPrime[p], n] == 8, Print[n]], {n, 1, 10^9}] (* _Robert G. Wilson v_, Feb 18 2004 *)

%o (Sage)

%o def A023150(max):

%o terms = []

%o p = 2

%o for n in range(1, max+1) :

%o if (p - 8) % n == 0 : terms.append(n)

%o p = next_prime(p)

%o return terms

%o # _Eric M. Schmidt_, Feb 05 2013

%Y Cf. A092050, A023143, A023144, A023145, A023146, A023147, A023148, A023149, A023151, A023152.

%K nonn

%O 1,2

%A _David W. Wilson_

%E More terms from _Robert G. Wilson v_, Feb 18 2004

%E a(15)-a(18) from _Robert G. Wilson v_, Feb 22 2006

%E First two terms inserted by _Eric M. Schmidt_, Feb 05 2013

%E Terms a(19) and beyond from _Giovanni Resta_, Feb 23 2020