|
|
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
|
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.
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
|
|
|
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):
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|