login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A185398 a(n) is the number of odd primes p < prime(n)^2 such that prime(n)# - p is prime. 2
0, 1, 6, 9, 15, 14, 21, 24, 22, 43, 38, 50, 54, 43, 61, 62, 74, 66, 79, 81, 87, 94, 93, 99, 101, 101, 110, 114, 119, 123, 129, 136, 160, 150, 184, 158, 178, 196, 171, 176, 180, 190, 201, 202, 222, 221, 230, 252, 242, 244, 251, 235, 261, 262 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

a(n) is not so far from prime(n).

LINKS

Pierre CAMI, Table of n, a(n) for n = 1..176

EXAMPLE

prime(1)#=2 , a(n)=0 ( no solution )

prime(2)#=6 , 6-3=3 prime , a(1)=1

prime(3)#=30, 30-7=23,30-11=19,30-13=17,30-17=13,30-19=11,30-23=7

so a(3)=6

PROG

(PFGW Scriptify) SCRIPT

DIM nn, 1

DIM kk

DIM cc

DIM dd

DIMS tt

DIMS ss

OPENFILEOUT myout, res

LABEL loopn

SET nn, nn+1

SET kk, nn

SET cc, 0

SET dd, 0

LABEL loopk

SET kk, kk+1

IF p(kk)>p(nn)^2 THEN GOTO a

SETS tt, %d, %d, %d\,; nn; p(nn); -p(kk)

PRP p(nn)#-p(kk), tt

IF ISPRIME THEN SET cc, cc+1

IF ISPRP THEN SET cc, cc+1

SETS tt, %d, %d, %d\,; nn; p(nn); p(kk)

PRP p(nn)#+p(kk), tt

IF ISPRIME THEN SET dd, dd+1

IF ISPRP THEN SET dd, dd+1

GOTO loopk

LABEL a

SETS ss, %d, %d, %d\,; nn; cc; dd

WRITE myout, ss

GOTO loopn

(PARI) a(n)=my(P=prod(k=1, n, prime(k)), s=0); forprime(p=2, prime(n)^2, s+=ispseudoprime(P-p)); s

CROSSREFS

Cf. A186413.

Sequence in context: A303162 A242042 A316021 * A316022 A316023 A139322

Adjacent sequences:  A185395 A185396 A185397 * A185399 A185400 A185401

KEYWORD

nonn

AUTHOR

Pierre CAMI, Feb 21 2011

EXTENSIONS

Edited by Charles R Greathouse IV, Feb 21 2011

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 26 00:08 EST 2020. Contains 332270 sequences. (Running on oeis4.)