login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A075323 Pair the odd primes so that the n-th pair is (p, p+2n) where p is the smallest prime not included earlier such that p and p+2n are primes and p+2n also does not occur earlier: (3, 5), (7, 11), (13, 19), (23, 31), (37, 47), (17, 29), ... This lists the successive pairs in order. 5

%I #21 Feb 12 2018 11:03:12

%S 3,5,7,11,13,19,23,31,37,47,17,29,53,67,43,59,61,79,83,103,109,131,73,

%T 97,101,127,139,167,41,71,149,181,157,191,137,173,113,151,193,233,197,

%U 239,179,223,211,257,229,277,263,313,199

%N Pair the odd primes so that the n-th pair is (p, p+2n) where p is the smallest prime not included earlier such that p and p+2n are primes and p+2n also does not occur earlier: (3, 5), (7, 11), (13, 19), (23, 31), (37, 47), (17, 29), ... This lists the successive pairs in order.

%C Question: Is every odd prime a member of some pair?

%C 2683 = A065091(388) seems to be missing, as presumably A247233(388)=0; but if A247233(n) > 0: a(A247233(n)) = A065091(n) = A000040(n+1). - _Reinhard Zumkeller_, Nov 29 2014

%H Reinhard Zumkeller, <a href="/A075323/b075323.txt">Table of n, a(n) for n = 1..10000</a>

%p # A075321p implemented in A075321

%p A075323 := proc(n)

%p if type(n,'odd') then

%p op(1,A075321p((n+1)/2)) ;

%p else

%p op(2,A075321p(n/2)) ;

%p end if;

%p end proc:

%p seq(A075323(n),n=1..60) ; # _R. J. Mathar_, Nov 26 2014

%t A075321p[n_] := A075321p[n] = Module[{prevlist, i, p, q}, If[n == 1, Return[{3, 5}], prevlist = Array[A075321p, n - 1] // Flatten]; For[i = 2, True, i++, p = Prime[i]; If[FreeQ[prevlist, p], q = p + 2*n; If[PrimeQ[q] && FreeQ[prevlist, q], Return[{p, q}]]]]];

%t A075323[n_] := If[OddQ[n], A075321p[(n+1)/2][[1]], A075321p[n/2][[2]]];

%t Array[A075323, 50] (* _Jean-François Alcover_, Feb 12 2018, after _R. J. Mathar_ *)

%o (Haskell)

%o import Data.List ((\\))

%o a075323 n = a075323_list !! (n-1)

%o a075323_list = f 1 [] $ tail a000040_list where

%o f k ys qs = g qs where

%o g (p:ps) | a010051' pk == 0 || pk `elem` ys = g ps

%o | otherwise = p : pk : f (k + 1) (p:pk:ys) (qs \\ [p, pk])

%o where pk = p + 2 * k

%o -- _Reinhard Zumkeller_, Nov 29 2014

%Y Cf. A075321, A075322.

%Y Cf. A010051, A000040, A065091, A247233.

%K nonn

%O 1,1

%A _Amarnath Murthy_, Sep 14 2002

%E Corrected by _R. J. Mathar_, Nov 26 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 03:30 EDT 2024. Contains 371906 sequences. (Running on oeis4.)