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!)
A175118 a(1)=2. a(n) = the smallest prime p > a(n-1) such that p-a(n-1)+1 is composite. 3

%I #11 Mar 11 2014 01:32:50

%S 2,5,13,37,61,109,157,181,229,263,271,347,367,401,409,433,457,491,499,

%T 523,547,571,619,643,677,691,739,773,787,811,859,883,907,941,967,991,

%U 1039,1063,1087,1151,1171,1289,1297,1321,1439,1447,1471,1613,1621,1669

%N a(1)=2. a(n) = the smallest prime p > a(n-1) such that p-a(n-1)+1 is composite.

%C A175119(n) = a(n+1) - a(n) + 1.

%H Zak Seidov, <a href="/A175118/b175118.txt">Table of n, a(n) for n = 1..1000</a>

%t a = 2; s = {a}; c = 1; lim = 50;While[c < m, p = NextPrime[a]; While[PrimeQ[p - a + 1], p = NextPrime[p]]; a = p; AppendTo[s, a]; c++]; s (* _Zak Seidov_, Nov 19 2012 *)

%o (Haskell)

%o a175118 n = a175118_list !! (n-1)

%o a175118_list = 2 : f 2 a000040_list where

%o f x ps = g $ dropWhile (<= x) ps where

%o g (q:qs) | a010051' (q - x + 1) == 1 = g qs

%o | otherwise = q : f q qs

%o -- _Reinhard Zumkeller_, Nov 20 2012

%Y Cf. A175119, A175120.

%Y Cf. A010051, A000040.

%K nonn

%O 1,1

%A _Leroy Quet_, Feb 14 2010

%E Extended by _Ray Chandler_, Mar 10 2010

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 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)