|
Search: id:A065081
|
|
|
| A065081 |
|
Alternating bit sum (A065359) for n-th prime p: replace 2^k with (-1)^k in binary expansion of p. |
|
+0 2
|
|
| -1, 0, 2, 1, -1, 1, 2, 1, 2, 2, 1, 1, -1, -2, -1, 2, -1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, -1, 1, 2, 1, -1, -1, -2, 2, 1, 1, -2, -1, -1, -1, 1, -1, 1, 2, 1, 1, 1, -1, 1, -1, -1, 1, -1, 2, 2, 2, 1, 4, 2, 1, 2, 1, 2, 1, 2, 1, 4, 2, 4, 2, 2, 1, 4, 1, 2, 2, 1, 2, 1, -1, 1, -1, 1, 1, -1, 2, 1, 2, 1, 2, 2, 1, -1, 1, 2, 2, -1, -2, 1
(list; graph; listen)
|
|
|
OFFSET
|
1,3
|
|
|
COMMENT
|
Only 3d = 11b has an alternating sum of 0.
|
|
LINKS
|
Harry J. Smith, Table of n, a(n) for n=1,...,1000
William Paulsen, wpaulsen(AT)csm.astate.edu, Partitioning the [prime] maze
|
|
EXAMPLE
|
The sixth prime is 13d = 1101b -> -(1)+(1)-(0)+(1) = 1 = a(6)
|
|
MATHEMATICA
|
f[n_] := (d = Reverse[ IntegerDigits[n, 2]]; l = Length[d]; s = 0; k = 1; While[k < l + 1, s = s - (-1)^k*d[[k]]; k++ ]; s); Table[ Prime[ f[n]], {n, 1, 100} ]
|
|
PROGRAM
|
(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) } { for (n=1, 1000, p=prime(n); s=SumAD(baseE(p, 2)); write("b065081.txt", n, " ", s) ) } [From Harry J. Smith (hjsmithh(AT)sbcglobal.net), Oct 06 2009]
|
|
CROSSREFS
|
Cf. A065359.
Sequence in context: A064693 A072085 A054868 this_sequence A025909 A025899 A025869
Adjacent sequences: A065078 A065079 A065080 this_sequence A065082 A065083 A065084
|
|
KEYWORD
|
base,easy,sign
|
|
AUTHOR
|
Robert G. Wilson v (rgwv(AT)rgwv.com), Nov 09 2001
|
|
|
Search completed in 0.002 seconds
|