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.

A065079 Primes > 3 for which the alternating bit sum (A065359) is not equal to 1 or 2.

Original entry on oeis.org

11, 41, 43, 47, 59, 107, 131, 137, 139, 163, 167, 173, 179, 191, 227, 233, 239, 251, 277, 337, 349, 373, 419, 431, 443, 491, 521, 523, 547, 557, 563, 569, 571, 587, 617, 619, 641, 643, 647, 653, 659, 673, 677, 683, 691, 701, 719, 739, 743, 751, 761, 809
Offset: 1

Views

Author

Robert G. Wilson v, Nov 08 2001

Keywords

Comments

Differs from A065049 beginning with 683.

Examples

			11 is in the sequence because 11d = 1011b, so the alternating digits sum of 11 is 1 -1 +0 -1 = -1 which is neither 1 nor 2.
		

References

  • William Paulsen, wpaulsen(AT)csm.astate.edu, personal communication.

Crossrefs

Cf. A065049.

Programs

  • Mathematica
    Do[d = Reverse[ IntegerDigits[ Prime[n], 2]]; l = Length[d]; s = 0; k = 1; While[k < l + 1, s = s - (-1)^k*d[[k]]; k++ ]; If[s != 1 && s != 2, Print[ Prime[n]]], {n, 3, 141} ]
  • PARI
    baseE(x, b)= { local(d, e=0, f=1); while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) } SumAD(x)= { local(a=1, s=0); while (x>9, s+=a*(x-10*(x\10)); x\=10; a=-a); return(s + a*x) } { n=0; for (m=3, 10^9, p=prime(m); s=SumAD(baseE(p, 2)); if (s!=1 && s!=2, write("b065079.txt", n++, " ", p); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 06 2009
    
  • PARI
    f(p)={s=0;u=1;for(k=0,#binary(p)-1,s+=bittest(p,k)*u;u=-u);return(s)};forprime(p=5,809,F=f(p);if((F!=1)&&(F!=2),print1(p,", "))) \\ Washington Bomfim, Jan 18 2011

Extensions

"> 3" added to definition by Harry J. Smith, Oct 06 2009