Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A103509
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A103509 a(n) = Least i, such that 2n+1 = 2*A000040(k)+A000040(i) for some k>1, 0 if no such i exists. +0
4
0, 0, 0, 2, 3, 2, 3, 2, 3, 4, 6, 2, 3, 2, 3, 4, 6, 2, 3, 2, 3, 4, 6, 2, 3, 4, 7, 5, 6, 2, 3, 2, 3, 4, 6, 5, 6, 2, 3, 4, 12, 2, 3, 2, 3, 4, 6, 2, 3, 4, 7, 5, 6, 2, 3, 4, 10, 5, 6, 2, 3, 2, 3, 4, 6, 5, 6, 2, 3, 4, 12, 2, 3, 2, 3, 4, 6, 5, 6, 2, 3, 4, 18, 2, 3, 4, 7, 5, 6, 2, 3, 4, 10, 5, 6, 15, 7, 2, 3, 4, 12, 2, 3, 2, 3 (list; graph; listen)
OFFSET

1,4

EXAMPLE

For n < 4 there are no such primes, thus a(1)-a(3)=0. For n=4, 2*4+1 = 9 = 2*3+3 and 3=A000040(2), thus a(4)=2. For n=11, 2*11+1 = 23 = 13+2*5 and 13=A000040(6), thus a(11)=6.

MATHEMATICA

Do[m = 3; While[ ! (PrimeQ[m] && (((n - m)/2) > 2) && PrimeQ[(n - m)/2]), m = m + 2]; k = PrimePi[m]; Print[k], {n, 9, 299, 2}]

PROGRAM

(Scheme, with Aubrey Jaffer's SLIB Scheme library from http://www.swiss.ai.mit.edu/~jaffer/SLIB.html )

(define (A103509 n) (let ((o (+ (* 2 n) 1))) (let loop ((i 2)) (let ((p2 (A000040 i))) (cond ((> p2 (- o 6)) 0) ((prime? (/ (- o p2) 2)) i) (else (loop (+ 1 i))))))))

CROSSREFS

a(n) = A049084(A103506(n)), for n >= 4. Can be used to compute A103506 and A103510. Cf. A103507.

Sequence in context: A071995 A114108 A073820 this_sequence A069898 A007978 A096737

Adjacent sequences: A103506 A103507 A103508 this_sequence A103510 A103511 A103512

KEYWORD

nonn

AUTHOR

Lei Zhou (lzhou5(AT)emory.edu), Feb 10 2005

EXTENSIONS

Edited and Scheme-code added by Antti Karttunen (His-Firstname.His-Surname(AT)gmail.com), Jun 19 2007

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 3 22:15 EST 2009. Contains 170310 sequences.


AT&T Labs Research