login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A092951 Beginning with n, add the next number, subtract the previous number, and so on; then a(n) is the largest prime arising in this process, or 0 if no prime is reached in 2n-1 steps: a(n) is the largest occurring prime in the sum n + (n+1) - (n-1) + (n+2) - (n-2) + (n+3) - (n-3) + ... +- 1 occurring at any stage. 1
3, 5, 7, 17, 19, 37, 37, 41, 67, 101, 103, 73, 107, 197, 199, 257, 257, 157, 263, 401, 401, 269, 487, 577, 577, 677, 677, 281, 787, 421, 787, 593, 907, 797, 1091, 1297, 1297, 1301, 1447, 1601, 1601, 1453, 1607, 1609, 1459 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Conjecture: No term is zero.
LINKS
EXAMPLE
a(5) = 19: the steps are 5, 5+6, 5+6-4, 5+6-4+7, 5+6-4+7-3, 5+6-4+7-3+8, 5+6-4+7-3+8-2, 5+6-4+7-3+8-2+9, 5+6-4+7-3+8-2+9-1, and the numbers arising are 5, 11, 7, 14, 11, 19, 17, 26, 25; 19 is the largest prime.
PROG
(GAP) A := function ( n ) local m, p, l, u; p := 0; u := n + 1; l := n - 1; m := n; if IsPrime( m ) then p := m; fi; repeat m := m + u; if IsPrime( m ) then p := m; fi; u := u + 1; m := m - l; if m > p and IsPrime( m ) then p := m; fi; l := l - 1; until l = 0; return p; end; # Simon Nickerson (simonn(AT)maths.bham.ac.uk, Jun 29 2005
CROSSREFS
Cf. A092950.
Sequence in context: A085499 A169628 A171254 * A001259 A248370 A087126
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 24 2004
EXTENSIONS
More terms from Simon Nickerson (simonn(AT)maths.bham.ac.uk, Jun 29 2005)
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 02:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)