login
A103510
a(n) = 1 + 2 * least i such that A103509(i)=n+1, 0 if no such i exists.
3
9, 11, 21, 57, 23, 55, 245, 241, 115, 833, 83, 523, 437, 193, 447, 733, 167, 689, 1417, 611, 2297, 1081, 2731, 1283, 2755, 5057, 2761, 887, 2719, 9221, 4909, 8179, 4397, 13891, 9557, 2351, 9257, 5869, 10627, 11941, 1487, 2797, 3947, 5899, 11237, 20069
OFFSET
1,1
MATHEMATICA
Array[a, 500]; Do[a[n] = 0, {n, 1, 500}]; n = 9; ct = 0; While[ct < 150, m = 3; While[ ! (PrimeQ[m] && (((n - m)/2) > 2) && PrimeQ[(n - m)/2]), m = m + 2]; k = PrimePi[m]; If[a[k] == 0, a[k] = n; ct = ct + 1]; n = n + 2]; Print[a]
PROG
(Scheme:) (define (A103510 n) (+ 1 (* 2 (first-n-where-fun_n-is-i1 A103509 (+ 1 n)))))
(define (first-n-where-fun_n-is-i1 fun i) (let loop ((n 1)) (cond ((= i (fun n)) n) (else (loop (+ n 1))))))
KEYWORD
nonn,hard
AUTHOR
Lei Zhou, Feb 10 2005
EXTENSIONS
Edited and Scheme-code added by Antti Karttunen, Jun 19 2007
STATUS
approved