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!)
A274649 a(n) is the smallest odd prime that divides n + the sum of all smaller primes, or 0 if no such prime exists. 2
5, 3, 30915397, 11339869, 3, 5, 859, 3, 41, 233, 3, 7, 4175194313, 3, 307, 5, 3, 1459, 7, 3, 5, 9907, 3, 647, 13, 3, 31, 11, 3, 193, 5, 3, 7, 2939, 3, 5, 3167, 3, 11, 7, 3, 1321, 86629, 3, 17, 5, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
From David A. Corneth, Nov 12 2016: (Start)
a(n) is the smallest odd prime p such that p|(n + A007504(primepi(p) - 1)) or zero if no such p exists.
If a(n) = p then a(n + p) <= p. (End)
If n is congruent to 1 (mod 3), then a(n)=3.
a(2), a(3) and a(12) were found by Jack Brennen.
From Robert G. Wilson v, Nov 13 2016: (Start)
If n == 1 (mod 3) then a(n) = 3;
If n == 0 (mod 5) then a(n) = 5;
If n == 4 (mod 7) then a(n) = 7;
if n == 5 (mod 11) then a(n) = 11;
if n == 11 (mod 13) then a(n) = 13;
if n == 10 (mod 17) then a(n) = 17;
if n == 18 (mod 19) then a(n) = 19;
if n == 23 (mod 23) then a(n) = 23;
in that order, i.e., from smallest to greatest prime modulus, etc.
First occurrence of p > 2: 1, 0, 11, 27, 24, 44, 56, 84, 161, ..., .
a(47) > 10^11. (End)
LINKS
Michael S. Branicky, Alternate Python program.
EXAMPLE
a(6) = 859 because 859 is the smallest odd prime that divides the sum of 6 + (sum of all primes smaller than itself).
a(8) = 41 because 8+2+3+5+7+11+13+17+19+23+29+31+37+41 = 246 and 246/41 = 6.
MATHEMATICA
f[n_] := Block[{p = 3, s = n +2}, While[ Mod[s, p] != 0, s = s + p; p = NextPrime@ p]; p]; Array[f, 47, 0] (* Robert G. Wilson v, Nov 12 2016 *)
PROG
(Python) # see link for an alternate that searches in parallel to a limit
from sympy import nextprime
def a(n):
psum, p = 2, 3
while (n + psum)%p: psum, p = psum + p, nextprime(p)
return p
for n in range(12):
print(a(n), end=", ") # Michael S. Branicky, May 03 2021
CROSSREFS
Cf. A016777 (n==1 (mod 3))
Sequence in context: A304287 A121021 A237518 * A343958 A258234 A336075
KEYWORD
nonn,more
AUTHOR
Neil Fernandez, Nov 10 2016
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 April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)