[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A094934 Write binary digits of numbers 1, 2, 3, ... in a string; sequence gives the prime indexed digits. 1
1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
EXAMPLE
In 1 10 11 100 101 110 111 1000 ... the prime indexed digits are 1,0,1,0,1,1,1,0
MATHEMATICA
almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Table[ almostNatural[n, 2], {n, Prime@ Range@ 105}] (* Robert G. Wilson v, Jun 29 2014 *)
PROG
(PARI) { x=1; xlc=0; xl=0; forprime (p=2, 1000, fl=1; if (xlc>=p && xlc-xl<p, fl=0; print1(", "xb[p-xlc+xl])); while (fl==1, xb=binary(x); xl=length(xb); xlc+=xl; if (xlc>=p && xlc-xl<p, fl=0; print1(", "xb[p-xlc+xl])); x++)) }
CROSSREFS
Sequence in context: A114607 A123110 A004593 * A245837 A245656 A354032
KEYWORD
nonn,base
AUTHOR
Jon Perry, Jun 17 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 29 00:59 EDT 2024. Contains 375508 sequences. (Running on oeis4.)