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!)
A175094 a(1) = 1, a(2) = 3, for n >= 3, a(n) = smallest prime > a(n-1) such that a(n) mod a(n-1) = a(n-2). 3
1, 3, 7, 17, 41, 181, 1489, 18049, 218077, 1326511, 69196649, 3045979067, 67080736123, 942176284789, 15141901292747, 31225978870283, 577209520957841, 9266578314195739, 575105065001093659, 5760317228325132329, 104260815174853475581, 3967671293872757204407 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(390) has 1001 digits. - Michael S. Branicky, Dec 21 2023
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..389
MATHEMATICA
nmax= 13; a[1]=1; a[2]=3; 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 *)
PROG
(Python)
from gmpy2 import is_prime
from itertools import count, islice
def agen(): # generator of terms
c, b = 1, 3
yield from [c, b]
for n in count(3):
a = next(c + b*i for i in count(1) if is_prime(c+b*i))
c, b = b, a
yield a
print(list(islice(agen(), 22))) # Michael S. Branicky, Dec 21 2023
CROSSREFS
Sequence in context: A259855 A058351 A244782 * A086395 A020730 A003440
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Jan 31 2010
EXTENSIONS
Definition corrected by Stefano Spezia, Sep 16 2022
a(14) and beyond from Michael S. Branicky, Dec 21 2023
STATUS
approved

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 March 19 04:58 EDT 2024. Contains 370952 sequences. (Running on oeis4.)