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.

A124522 a(n) = smallest k such that 2nk-1 and 2nk+1 are primes.

This page as a plain text file.
%I A124522 #17 Mar 30 2024 17:30:56
%S A124522 2,1,1,9,3,1,3,12,1,3,9,3,12,15,1,6,3,2,6,6,1,15,3,4,3,6,2,48,6,1,21,
%T A124522 3,3,15,6,1,27,3,4,3,15,5,12,15,2,9,3,2,9,6,1,3,60,1,6,24,2,3,9,2,129,
%U A124522 12,7,9,15,5,12,27,1,3,9,3,42,45,1,90,3,2,66,21,5,63,27,16,6,6,2,12,24,1,6
%N A124522 a(n) = smallest k such that 2nk-1 and 2nk+1 are primes.
%H A124522 Robert Israel, <a href="/A124522/b124522.txt">Table of n, a(n) for n = 1..10000</a>
%p A124522 isA001359 := proc(n) RETURN( isprime(n) and isprime(n+2)) ; end: A124522 := proc(n) local k; k :=1 ; while true do if isA001359(2*n*k-1) then RETURN(k) ; fi ; k := k+1 ; od ; end: for n from 1 to 60 do printf("%d,",A124522(n)) ; od ; # _R. J. Mathar_, Nov 06 2006
%t A124522 f[n_] := Block[{k = 1},While[Nand @@ PrimeQ[{-1, 1} + 2n*k], k++ ];k];Table[f[n], {n, 91}] (* _Ray Chandler_, Nov 16 2006 *)
%t A124522 skp[n_]:=Module[{k=1},While[AnyTrue[2n k+{1,-1},CompositeQ],k++];k]; Join[{2},Array[skp,100,2]] (* _Harvey P. Dale_, Mar 30 2024 *)
%o A124522 (PARI) {for(n=1,91,k=1;while(!isprime(2*n*k-1)||!isprime(2*n*k+1),k++);print1(k, ","))}
%Y A124522 Cf. A040040, A045753, A002822, A124065, A124518-A124522, A063983.
%K A124522 nonn
%O A124522 1,1
%A A124522 _Artur Jasinski_, Nov 04 2006
%E A124522 Edited and extended by _Klaus Brockhaus_ and _R. J. Mathar_, Nov 06 2006