cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A366931 Least k such that 3*n*k+1 is a prime.

This page as a plain text file.
%I A366931 #20 Jan 09 2025 18:43:07
%S A366931 2,1,2,1,2,1,2,3,4,1,2,1,2,1,4,2,2,2,4,1,2,1,2,1,2,1,2,4,4,2,4,1,2,1,
%T A366931 2,1,2,2,8,2,6,1,8,3,2,1,2,3,6,1,2,1,20,1,2,2,12,2,4,1,2,2,2,1,6,1,8,
%U A366931 2,4,1,4,2,2,1,8,1,2,4,6,1,2,3,2,3,4,4
%N A366931 Least k such that 3*n*k+1 is a prime.
%H A366931 Robert Price, <a href="/A366931/b366931.txt">Table of n, a(n) for n = 1..5000</a>
%t A366931 A366931 = {};
%t A366931 Do[k=1; While[!PrimeQ[3 n k+1], k++]; AppendTo[A366931 ,k], {n,85}];
%t A366931 A366931
%t A366931 lkp[n_]:=Module[{k=1},While[!PrimeQ[3n*k+1],k++];k]; Array[lkp,90] (* _Harvey P. Dale_, Jan 09 2025 *)
%o A366931 (PARI) a(n) = my(k=1); while (!isprime(3*n*k+1), k++); k; \\ _Michel Marcus_, Dec 17 2023
%Y A366931 Cf. A016014, A024892.
%Y A366931 A070847 lists the corresponding primes.
%K A366931 nonn
%O A366931 1,1
%A A366931 _Robert Price_, Dec 17 2023