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!)
A175207 a(1) = 1, a(2) = 5, for n >= 3, a(n) = smallest prime > a(n-1) such that a(n) mod a(n-1) = a(n-2). 3

%I #17 Dec 21 2023 15:03:43

%S 1,5,11,71,863,10427,42571,95569,2145089,42997349,1292065559,

%T 12963652939,27219371437,285157367309,6870996186853,261383012467723,

%U 10984957519831219,922997814678290119,27700919397868534789,333334030589100707587,3361041225288875610659

%N a(1) = 1, a(2) = 5, for n >= 3, a(n) = smallest prime > a(n-1) such that a(n) mod a(n-1) = a(n-2).

%C a(389) has 1002 digits. - _Michael S. Branicky_, Dec 21 2023

%H Michael S. Branicky, <a href="/A175207/b175207.txt">Table of n, a(n) for n = 1..388</a>

%t nmax= 11; a[1]=1; a[2]=5; kmin=1; For[n=3, n<=nmax, n++, For[k=kmin, k>0, k++, If[Mod[Prime[k],a[n-1]]==a[n-2], a[n]=Prime[k]; kmin=k; k=-1]]]; Array[a,nmax] (* _Stefano Spezia_, Sep 16 2022 *)

%o (Python)

%o from gmpy2 import is_prime

%o from itertools import count, islice

%o def agen(): # generator of terms

%o c, b = 1, 5

%o yield from [c, b]

%o for n in count(3):

%o a = next(c + b*i for i in count(1) if is_prime(c+b*i))

%o c, b = b, a

%o yield a

%o print(list(islice(agen(), 22))) # _Michael S. Branicky_, Dec 21 2023

%Y Cf. A175093, A175094, A175208.

%K nonn

%O 1,2

%A _Jaroslav Krizek_, Mar 04 2010

%E Definition corrected by _Stefano Spezia_, Sep 16 2022

%E a(12) and beyond from _Michael S. Branicky_, Dec 21 2023

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 25 06:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)