A355329 Least increasing sequence of primes such that a(n) - 1 is a multiple of 6*n.
7, 13, 19, 73, 151, 181, 211, 241, 271, 421, 463, 577, 859, 1009, 1171, 1249, 1327, 1621, 2053, 2161, 2269, 2377, 3037, 3169, 3301, 3433, 3727, 4201, 5569, 5581, 5953, 6337, 6733, 7549, 7561, 7993, 9103, 9349, 9829, 10321, 10333, 10837, 11353, 11617, 12421, 12697, 12973, 13249, 14407, 15601
Offset: 1
Keywords
Examples
a(5) = 151 because 151 is prime, 151-1 = 150 is divisible by 6*5, and 151 > a(4) = 73.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A070850.
Programs
-
Maple
A:= Vector(100): A[1]:= 7: for n from 2 to 100 do for k from floor((A[n-1]-1)/(6*n))+1 do p:= 6*n*k+1; if isprime(p) then A[n]:= p; break fi od od: convert(A,list);
-
Mathematica
a[n_] := a[n] = Module[{p = If[n == 1, 2, NextPrime[a[n - 1]]]}, While[!Divisible[p - 1, 6*n], p = NextPrime[p]]; p]; Array[a, 50] (* Amiram Eldar, Jun 29 2022 *)
-
Python
from itertools import count, islice from sympy import nextprime def A355329_gen(): # generator of terms p = 2 for m in count(6,6): while q:=(p-1)%m: p = nextprime(p+m-q-1) yield p p = nextprime(p) A355329_list = list(islice(A355329_gen(),30)) # Chai Wah Wu, Jun 30 2022
Comments