cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A274995 a(n) is the smallest odd prime that divides (-n) + the sum of all smaller primes, or 0 if no such prime exists.

This page as a plain text file.
%I A274995 #35 Dec 01 2016 01:32:12
%S A274995 5,19,3,7,82811,3,11,17,3,191,5,3,37,29,3,5,69431799799,3,1105589,
%T A274995 28463,3,431,2947308589,3,7,5,3,59,11,3,5,7,3,41
%N A274995 a(n) is the smallest odd prime that divides (-n) + the sum of all smaller primes, or 0 if no such prime exists.
%C A274995 From _Robert G. Wilson v_, Nov 15 2016: (Start)
%C A274995 If n == 2 (mod 3) then a(n) = 3;
%C A274995 If n == 0 (mod 5) then a(n) = 5;
%C A274995 If n == 3 (mod 7) then a(n) = 7;
%C A274995 If n == 6 (mod 11) then a(n) = 11;
%C A274995 If n == 2 (mod 13) then a(n) = 13;
%C A274995 If n == 7 (mod 17) then a(n) = 17;
%C A274995 If n == 1 (mod 19) then a(n) = 19;
%C A274995 If n == 8 (mod 23) then a(n) = 23;
%C A274995 in that order; i.e., from smaller to greater prime modulus, etc.
%C A274995 First occurrence of p>2: 2, 0, 3, 6, 54, 7, 1, 123, 13, 36, 12, 33, 453, 46, ..., .
%C A274995 (End)
%C A274995 The congruence classes in the above list, modulo the prime bases, namely 2, 0, 3, 6, 2, ..., are given by A071089, in which each term is the remainder when the sum of the first n primes is divided by the n-th prime. - _Neil Fernandez_, Nov 23 2016
%H A274995 Robert G. Wilson v, <a href="/A274995/a274995.txt">n and a(n), or 0 if no such value is known, for n=0..10000</a>
%e A274995 a(1) = 19 because 19 is the smallest odd prime that divides the sum of (-1) + (sum of all primes smaller than itself), that is, -1 + 58 = 57.
%e A274995 a(7) = 17 because -7 + 2 + 3 + 5 + 7 + 11 + 13 + 17 = 49 and 49/7 = 7.
%t A274995 f[n_] := Block[{p = 3, s = 2 - n}, While[ Mod[s, p] != 0, s = s + p; p = NextPrime@ p]; p]; Array[f, 16, 0] (* _Robert G. Wilson v_, Nov 15 2016 *)
%o A274995 (PARI) sump(n) = s = 0; forprime(p=2, n-1, s+=p); s;
%o A274995 a(n) = {my(p=3); while ((sump(p)-n) % p, p = nextprime(p+1)); p;} \\ _Michel Marcus_, Nov 12 2016
%o A274995 (PARI) a(n)=my(s=2); forprime(p=3,, if((s-n)%p==0, return(p)); s+=p) \\ _Charles R Greathouse IV_, Nov 15 2016
%Y A274995 Cf. A007504, A007506, A071089, A274649.
%K A274995 nonn,more
%O A274995 0,1
%A A274995 _Neil Fernandez_, Nov 11 2016
%E A274995 a(16)-a(33) from _Charles R Greathouse IV_, Nov 15 2016