A274649 a(n) is the smallest odd prime that divides n + the sum of all smaller primes, or 0 if no such prime exists.
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
Offset: 0
Examples
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.
Links
- Michael S. Branicky, Alternate Python program.
- Michael S. Branicky, n and a(n) for n = 0..10000 or 0 of no such value is known, search limit = 9*10^9.
- Robert G. Wilson v, n and a(n) for n = 0..10000 or 0 if no such value is known.
Programs
-
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 *)
-
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
Comments