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!)
A363709 For n >= 0, a(n) is the least integer i >= 0 such that n + (n + 1) + ... + (n + i) is a prime number or a(n) = -1 if no such i exists. 0
2, 1, 0, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 0, 1, 1, -1, 0, 1, 0, 1, 1, -1, 0, -1, -1, 1, -1, -1, 0, 1, 0, -1, 1, -1, 1, 1, 0, -1, 1, -1, 0, -1, 0, 1, -1, -1, 0, 1, -1, 1, 1, -1, 0, 1, -1, 1, -1, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, 1, 1, -1, 0, -1, 0, 1, 1, -1, -1, 1, 0, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Shortest arithmetic sequence with initial term n and difference 1 that sums to a prime number.
For n = 0, a(n) = 2.
For n >= 1, a(n) < 2.
For n in A053176 or A005384, a(n) = 0.
For n in A067812, a(n) = 1.
For n in A077654, a(n) = -1.
LINKS
FORMULA
((i + 1)*(i + 2*n))/2 = p, p prime number.
EXAMPLE
n = 4: no such i exists, thus a(4) = -1.
n = 5: n is prime, i = 0, thus a(5) = 0.
n = 6: n + (n + 1) = 6 + 7 = 13 is prime, i = 1, thus a(6) = 1.
CROSSREFS
Sequence in context: A130068 A316825 A333816 * A246398 A051699 A328682
KEYWORD
sign
AUTHOR
Ctibor O. Zizka, Jun 17 2023
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 May 2 08:27 EDT 2024. Contains 372178 sequences. (Running on oeis4.)