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.

A071089 Remainder when sum of first n primes is divided by n-th prime.

This page as a plain text file.
%I A071089 #44 Sep 19 2019 09:51:06
%S A071089 0,2,0,3,6,2,7,1,8,13,5,12,33,23,46,10,27,13,32,0,55,1,44,73,90,50,28,
%T A071089 87,63,11,69,17,70,42,41,11,72,139,75,146,44,8,9,164,88,48,7,201,121,
%U A071089 79,224,92,46,57,170,26,145,95,216,112,58,71,293,185,129,13,255,81,128
%N A071089 Remainder when sum of first n primes is divided by n-th prime.
%C A071089 Conjecture: Every nonnegative integer can appear in the sequence at most finitely many times. - _Thomas Ordowski_, Jul 22 2013
%C A071089 I conjecture the opposite. Heuristically a given number should appear log log x times below x. - _Charles R Greathouse IV_, Jul 22 2013
%C A071089 In the first 10000 terms, one sees a(n) = n for n=2,7,12. Does this ever happen again? - _J. M. Bergot_, Mar 26 2018
%C A071089 Yes, it happens for n = 83408, too. - _Michel Marcus_, Mar 27 2018
%H A071089 T. D. Noe, <a href="/A071089/b071089.txt">Table of n, a(n) for n = 1..10000</a>
%F A071089 a(n) = s[n] - p[n]*q[n], where s[n] = sum of first n primes, p[n] is n-th prime and q[n] is floor(s[n]/p[n]).
%F A071089 a(A024011(n)) = 0. - _Michel Marcus_, Jan 22 2015
%e A071089 a[5] = 6 because s[5] = 2+3+5+7+11 = 28, p[5]=11 and q[5]= floor(28/11)=2, so a[5] = 28-11*2 = 6.
%p A071089 s:= proc(n) option remember; `if`(n=0, 0, ithprime(n)+s(n-1)) end:
%p A071089 a:= n-> irem(s(n), ithprime(n)):
%p A071089 seq(a(n), n=1..100);  # _Alois P. Heinz_, Mar 27 2018
%t A071089 f[n_] := Mod[ Sum[ Prime[i], {i, 1, n - 1}], Prime[n]]; Table[ f[n], {n, 1, 70}] or
%t A071089 a[1] = 0; a[n_] := Block[{s = Sum[Prime[i], {i, 1, n}]}, s - Prime[n]*Floor[s/Prime[n]]]; Table[ f[n], {n, 1, 70}]
%t A071089 f[n_] := Mod[Plus @@ Prime@ Range@ n, Prime@ n]; Array[f, 70] (* _Robert G. Wilson v_, Nov 12 2016 *)
%t A071089 Module[{nn=70,t},t=Accumulate[Prime[Range[nn]]];Mod[#[[1]],#[[2]]]&/@ Thread[ {t,Prime[Range[nn]]}]] (* _Harvey P. Dale_, Sep 19 2019 *)
%o A071089 (PARI) for(n=1,100,s=sum(i=1,n, prime(i)); print1(s-prime(n)*floor(s/prime(n)),","))
%o A071089 (PARI) a(n) = vecsum(primes(n)) % prime(n); \\ _Michel Marcus_, Mar 27 2018
%o A071089 (GAP) P:=Filtered([1..1000],IsPrime);
%o A071089 a:=List([1..70],i->Sum(P{[1..i]}) mod P[i]); # _Muniru A Asiru_, Mar 27 2018
%Y A071089 Cf. A007506, A024011.
%K A071089 easy,nonn
%O A071089 1,2
%A A071089 _Randy L. Ekl_, May 26 2002
%E A071089 Edited by _Robert G. Wilson v_ and _Benoit Cloitre_, May 30 2002