OFFSET
1,1
COMMENTS
A break occurs at index 1213 of 9833 and 89 must be centrally located at index 419 prime 2897 and the monotonic sequence resumed from that point onward until the next break occurs
FORMULA
Centrally enclose the prime sequence in another montotonically increasing prime sequence (if a break occurs begin over at that point)
EXAMPLE
a(23) is the index 1213 of prime 9833 where the prime 83 is centrally located.
PROG
(UBASIC) 10 C=26:Q=str(C):T=443 20 'monotonically increasing primes 30 'centered in primes 40 'change val(m) in 100 50 'adjust T in line 10 after every break 60 N=101 70 A=3:S=sqrt(N) 80 B=N\A 90 if B*A=N then N=N+2:goto 70 100 A=A+2 110 if A<=sqrt(N) then 80 120 Z=str(N):W=alen(N):W=W-2:M=mid(Z, 3, W): if M=Q then print C, N:stop 130 if val(M)=nxtprm(T) then print Q, M, Z:T=val(M):stop 140 C=C+1:Q=str(C) 150 N=N+2:goto 70
CROSSREFS
KEYWORD
easy,nonn,uned
AUTHOR
Enoch Haga, Sep 23 2007
STATUS
approved