login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A135025 See Comments lines for definition. 3
4, 9, 22, 57, 146, 367, 946, 2507, 6634, 17777, 48522, 133107, 369020, 1028405, 2880288, 8100949 (list; graph; refs; listen; history; internal format)
OFFSET

1,1

COMMENTS

Let P(n) be the n-th prime. Construct the following sequence:

B(1) = 2

If n>= 2, then if (B(n-1) - P(n) < 0) then B(n) = B(n) + P(n) else B(n) = B(n) - P(n)

Definition: if n>=1, the term B(n) is stationary if it satisfies the inequality B(n-1) < B(n) < B(n+1). Sequence gives the indices n of the stationary terms.

EXAMPLE

B(1) = 2

B(2) = 5

B(3) = 0

B(4) = 7

B(5) = 18

B(4) is the first stationary term of B, so 4 is the first term of the sequence.

MAPLE

B := proc(n) option remember ; if n = 1 then 2; else if procname(n-1)-ithprime(n) < 0 then procname(n-1)+ithprime(n) ; else procname(n-1)-ithprime(n) ; fi; fi; end: A135025 := proc(n) option remember ; if n = 1 then 4; else for a from procname(n-1)+1 do if B(a-1) < B(a) and B(a) < B(a+1) then RETURN(a) ; fi; od: fi; end: for n from 1 do printf("%d, \n", A135025(n)) ; od: [From R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Feb 06 2009]

CROSSREFS

Cf. A135026.

Sequence in context: A042833 A048654 A122626 * A070713 A060250 A138991

Adjacent sequences:  A135022 A135023 A135024 * A135026 A135027 A135028

KEYWORD

nonn,more

AUTHOR

Lior Deutsch (liorde(AT)gmail.com), Feb 10 2008

EXTENSIONS

New term added by Lior Deutsch (liorde(AT)gmail.com), Oct 17 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 05:54 EST 2012. Contains 205985 sequences.