OFFSET
1,1
COMMENTS
Differs from A065049 beginning with 683.
REFERENCES
William Paulsen, wpaulsen(AT)csm.astate.edu, personal communication.
LINKS
Harry J. Smith, Table of n, a(n) for n=1,...,1000
EXAMPLE
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.
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} ]
PROG
(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
CROSSREFS
KEYWORD
base,nonn,easy
AUTHOR
Robert G. Wilson v, Nov 08 2001
EXTENSIONS
"> 3" added to definition by Harry J. Smith, Oct 06 2009
STATUS
approved