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.

User: Esko Ranta

Esko Ranta's wiki page.

Esko Ranta has authored 2 sequences.

A243593 Primes giving record values of f(n) = (2*Sum_{i=1..n}(i*prime(i)) / Sum_{i=1..n}(prime(i))-(n+1))/(n-1).

Original entry on oeis.org

5, 7, 11, 13, 17, 23, 29, 37, 41, 53, 59, 97, 101, 127, 131, 137, 149, 223, 227, 307, 331, 337, 347, 349, 419, 541, 547, 557, 563, 569, 587, 809, 821, 967, 1277, 1361, 1367, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1847, 1861, 1867, 1871, 1949, 1973
Offset: 1

Author

Esko Ranta, Jun 07 2014

Keywords

Comments

Is the sequence finite? It would mean that the value of f(n) would become monotonic after inclusion of the largest prime in the sequence.
It should be easy to prove that the value of lim 3*f(n) is 1 when n approaches infinity.
The generalized formula 3*(2*sum_XY/sum_Y - (n+1))/(n-1) is a non-linear correlation coefficient between the X (1,2,3...) and the nonnegative Y values, with range from -3 to +3, and linear correlation still giving value 1 or -1.
What is the next term after 32057?

Examples

			3rd prime is 5, and f(3) > f(2) so 5 is included in the sequence.
Starting at n=2, the values of f(n) are: 1/5, 3/10, 1/3, 11/28, 81/205, 71/174, 31/77, 81/200, 485/1161, ...
		

Programs

  • PARI
    f(n) = (2*sum(i=1,n,i*prime(i))/sum(i=1, n, prime(i)) - (n+1))/(n-1);
    lista(nn) = {last = f(2); for (i=3, nn, new = f(i); if (new > last, print1(prime(i), ", ");); new = last;);} \\ Michel Marcus, Jun 10 2014

A126084 a(n) = XOR of first n primes.

Original entry on oeis.org

0, 2, 1, 4, 3, 8, 5, 20, 7, 16, 13, 18, 55, 30, 53, 26, 47, 20, 41, 106, 45, 100, 43, 120, 33, 64, 37, 66, 41, 68, 53, 74, 201, 64, 203, 94, 201, 84, 247, 80, 253, 78, 251, 68, 133, 64, 135, 84, 139, 104, 141, 100, 139, 122, 129, 384, 135, 394, 133, 400, 137, 402, 183, 388, 179
Offset: 0

Author

Esko Ranta, Mar 02 2007

Keywords

Comments

The values at odd positive indices are even and the values at even positive indices are odd.
Does this sequence contain any zeros for n > 0? Probabilistically, one would expect so; but none in first 10000 terms. - Franklin T. Adams-Watters, Jul 17 2011
None below 1.5 * 10^11: any prime p such that a(pi(p)) = 0 is 43 bits or longer. Heuristic chances that a prime below 2^100 yields 0 are about 45%. Note that an n-bit prime can yield 0 only if a(pi(p)) is odd, where p is the smallest n-bit prime. That is, for n > 1, there are no zeros from pi(2^n) to pi(2^(n+1)) if A007053(n) is even. - Charles R Greathouse IV, Jul 17 2011

Examples

			a(4) = 3 because ((2 XOR 3) XOR 5) XOR 7 = (1 XOR 5) XOR 7 = 4 XOR 7 = 3
[Or, in base 2]
((10 XOR 11) XOR 101) XOR 111 = (1 XOR 101) XOR 111 = 100 XOR 111 = 11
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=70,prs},prs=Prime[Range[nn]];Table[BitXor@@Take[prs,n],{n,0,nn}]] (* Harvey P. Dale, Jun 23 2016 *)
  • PARI
    al(n)=local(m);vector(n,k,m=bitxor(m,prime(k))) /* Produces a vector without a(0) = 0; Franklin T. Adams-Watters, Jul 17 2011 */
    
  • PARI
    v=primes(300); for(i=2,#v,v[i]=bitxor(v[i],v[i-1])); concat(0, v) \\ Charles R Greathouse IV, Aug 26 2014
    
  • PARI
    q=0; forprime(p=2, 313, print1(q, ","); q=bitxor(q, p)) /* Klaus Brockhaus, Mar 06 2007; adapted by Rémy Sigrist, Oct 23 2017 */
    
  • Python
    from operator import xor
    from functools import reduce
    from sympy import primerange, prime
    def A126084(n): return reduce(xor,primerange(2,prime(n)+1)) if n else 0 # Chai Wah Wu, Jul 09 2022

Formula

a(0) = 0; a(n) = a(n-1) XOR prime(n).

Extensions

More terms from Klaus Brockhaus, Mar 06 2007
Edited by N. J. A. Sloane, Oct 22 2017 (merging old entry A193174 with this)
Edited by Rémy Sigrist, Oct 23 2017