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.

A120225 a(n) is the minimal number k>n such that n+k and n*k+1 are primes.

This page as a plain text file.
%I A120225 #7 May 15 2015 05:10:21
%S A120225 2,3,4,7,6,7,10,9,14,13,18,19,24,15,16,21,24,29,22,21,22,31,30,43,28,
%T A120225 33,34,39,32,41,36,39,34,37,66,43,60,41,50,43,42,55,46,53,52,51,50,59,
%U A120225 52,51,56,55,56,55,58,75,74,69,68,67,66,75,74,67,86,83,70,89,70,79,102,79
%N A120225 a(n) is the minimal number k>n such that n+k and n*k+1 are primes.
%C A120225 Differs from A120224 in the first term.
%H A120225 Harvey P. Dale, <a href="/A120225/b120225.txt">Table of n, a(n) for n = 1..1000</a>
%e A120225 a(3)=4 because 3+4=7 and 3*4+1=13 are prime;
%e A120225 a(8)=9 because 8+9=17 and 8*9+1=73 are prime,
%t A120225 Reap[Do[Do[If[PrimeQ[{n+x, n*x+1}]=={True,True},Sow[x];Break[]],{x, n+1,1000}],{n,120}]][[2,1]]
%t A120225 mnk[n_]:=Module[{k=n+1},While[!AllTrue[{n+k,n*k+1},PrimeQ],k++];k]; Array[ mnk,80] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, May 15 2015 *)
%Y A120225 Cf. A085063, A092945, A085063, A120223, A120224.
%K A120225 nonn
%O A120225 1,1
%A A120225 _Zak Seidov_, Jun 10 2006