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.

A133954 Difference between the numbers of nonnegative evil and odious multiples of p_n less than 2^p_n, where p_n = n-th prime.

Original entry on oeis.org

0, 3, 5, -7, 11, 13, 697, 19, -23, 29, -237367, 37, 97129, 44250483, -47, 53, 59, 61, 67, -71, 1325443061345, -79, 83, 6096136101052865, 6711137545, 101, -103, 107, 197096207419453, 1733616652657, -16388345406766785202757351, 131, 904581545
Offset: 1

Views

Author

Vladimir Shevelev, Sep 30 2007, Dec 17 2008

Keywords

Comments

The following statements are true: 1) If prime p_n has a primitive root 2, then a(n)=p_n; 2) If prime p_n has a semiprimitive root 2, then a(n)=-p_n (for definition of semiprimitive root 2 of a prime, see the 2nd link, p. 1).
A comparison of Gerbicz's calculations up to a(46) with A001122 and A139035 shows that one can conjecture that the converse statements are true as well.
Subset of A225855.

Examples

			Consider p_2=3; since 0,3,6 are evil, then a(2) = 3 - 0 = 3.
		

Crossrefs

Programs

  • PARI
    a(p)=o=e=vector(p,i,0);e[p]=1;r=1;for(i=1,p,o2=e2=vector(p);for(j=1,p,w=(j-r)%p;if(w==0,w=p);o2[j]=o[j]+e[w];e2[j]=e[j]+o[w]);o=o2;e=e2;r=(2*r)%p);return(e[p]-o[p]) \\ Robert Gerbicz, Jan 03 2011

Formula

a(n) = p_n if 2 is a primitive root of p_n (A001122); a(n) = -p_n if p_n is in A139035, i.e., -2 is a primitive root of p_n [Shevelev, 2007]. No other exact regularity of the sequence is known until now. - Vladimir Shevelev, Oct 26 2014

Extensions

Extended by Robert Gerbicz, Jan 03 2011