[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Search: a174208 -id:a174208
     Sort: relevance | references | number | modified | created      Format: long | short | data
In the sequence A007088 of binary representations of n, delete the 1st, 3rd, 5th, 7th, 9th etc occurrence of 0 and 1. Rewrite the bits left over in base 10.
+10
7
2, 1, 0, 1, 2, 3, 0, 2, 2, 5, 2, 1, 6, 3, 0, 2, 4, 5, 2, 1, 5, 3, 2, 2, 5, 5, 2, 3, 6, 7, 0, 4, 4, 9, 2, 1, 10, 3, 4, 2, 10, 5, 2, 5, 5, 11, 4, 2, 10, 5, 2, 5, 5, 11, 2, 6, 6, 13, 6, 3, 14, 7, 0, 4, 8, 9, 2, 1, 9, 3, 2, 2, 9, 5, 2, 5, 10, 11, 4
OFFSET
0,1
COMMENTS
Deleting the odd occurrences of 0 and the even occurrences of 1, we get the same sequence apart from the initial 2 replaced by 1 and 0.
EXAMPLE
Numbers in base 2: 0, 1, 10, 11, 100, 101, 110, 111, 1000, .... Delete odd occurrences of 0 (replaced by ~): ~, 1, 10, 11, 1~0, 1~1, 110, 111, 1~0~ Delete odd occurrences of 1 (replaced by ~): ~, ~, 10, ~1, ~~0, 1~~, 1~0, 1~1, ~~0~.
The pieces left are 10, 1, 0, 1, 10, 11, 0, ... which is in base 10: 2, 1, 0, 1, 2, 3, 0, ....
MAPLE
n1 := 1 ; n0 := 1 ;
for n from 0 to 80 do
if n = 0 then b := [0] ; else b := convert(n, base, 2) ; end if;
for d from nops(b) to 1 by -1 do
if op(d, b) = 0 then
if type(n0, 'odd') then b := subsop(d=NULL, b) ; end if; n0 := n0+1 ;
else
if type(n1, 'odd') then b := subsop(d=NULL, b) ; end if; n1 := n1+1 ;
end if;
end do:
add(2^(i-1)*op(i, b), i=1..nops(b)) ; printf("%d, ", %) ;
end do: # R. J. Mathar, Nov 23 2010
KEYWORD
easy,nonn,base,less
AUTHOR
EXTENSIONS
Sequence extended, keyword:base,less added by R. J. Mathar, Nov 23 2010
STATUS
approved
Depleted stream of the natural numbers written in base 2: delete even occurrences of digit 0 and odd occurrences of digit 1.
+10
4
0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0
OFFSET
0,1
COMMENTS
The numbers in base 2: 0, 1, 10, 11, 100, 101, 110, 111, 1000, ....
The infinite stream of digits: 0110111001011101111000...
Delete even (2nd, 4th, 6th, ...) occurrences of 0 (replaced by ~):
011~1110~10111~11110~0...
Delete odd (1st, 3rd, 5th, ...) occurrences of 1 (replaced by ~):
0~1~~1~0~10~1~~1~1~0~0...
Digits remaining define the sequence: 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, ....
MAPLE
nb := 100 ;
L := [0] ;
for n from 1 to nb do
nn := ListTools[Reverse](convert(n, base, 2)) ;
L := [op(L), op(nn)] ;
end do;
Lout := [] ;
ie :=1 ;
io :=1 ;
for i from 1 to nops(L) do
if op(i, L) =0 then
if ie>0 then
if type(ie, 'odd') then
printf("%d, ", 0) ;
end if;
end if;
ie := ie+1 ;
else
if io>0 then
if type(io, 'even') then
printf("%d, ", 1) ;
end if;
end if;
io := io+1 ;
end if;
end do: # R. J. Mathar, Dec 06 2011
MATHEMATICA
nMax = 60; bits = Join @@ Table[IntegerDigits[n, 2], {n, 0, nMax}]; pos0 = Position[bits, 0] // Flatten; even0 = Partition[pos0, 2][[All, 2]]; bits2 = ReplacePart[bits, Alternatives @@ even0 -> "~"]; pos1 = Position[bits2, 1] // Flatten; odd1 = Partition[pos1, 2][[All, 1]]; DeleteCases[ ReplacePart[ bits2, Alternatives @@ odd1 -> "~"], "~"] (* Jean-François Alcover, Nov 18 2016 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
STATUS
approved
In the sequence of natural numbers, moving left to right, delete 1st, 3rd, 5th, 7th etc occurrence of each of the ten digits.
+10
3
10, 1, 2, 13, 4, 15, 6, 17, 8, 19, 2, 2, 2, 2, 2, 30, 1, 32, 3, 4, 35, 6, 37, 8, 39, 4, 4, 4, 4, 4, 50, 1, 52, 3, 54, 5, 6, 57, 8, 59, 6, 6, 6, 6, 6, 70, 1, 72, 3, 74, 5, 76, 7, 8, 79, 8, 8, 8, 8, 8, 90, 1, 92, 3, 94, 5, 96, 7, 98, 9, 0, 10, 1, 0, 1, 0, 1, 0, 1, 0, 1, 11, 12, 13, 14, 15, 16, 17
OFFSET
0,1
EXAMPLE
Starting from
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,20,21,22,23,24,25,26,27,28,29,..
Delete odd occurrences of digit 0 (replaced by ~):
,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2~,21,22,23,24,25,26,27,28,29,..
Delete odd occurrences of digit 1 (replaced by ~):
,~,2,3,4,5,6,7,8,9,10,~1,~2,13,~4,15,~6,17,~8,19,2~,2~,22,23,24,25,26,27,28,29 ,..
Delete odd occurrences of digit 2 (replaced by ~):
,~,~,3,4,5,6,7,8,9,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~3,24,~5,26,~7,28,~9 ,..
Delete odd occurrences of digit 3 (replaced by ~):
,~,~,~,4,5,6,7,8,9,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~~,24,~5,26,~7,28,~9,..
Delete odd occurrences of digit 4 (replaced by ~):
,~,~,~,~,5,6,7,8,9,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~~,2~,~5,26,~7,28,~9,..
Delete odd occurrences of digit 5 (replaced by ~):
,~,~,~,~,~,6,7,8,9,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~~,2~,~~,26,~7,28,~9,..
Delete odd occurrences of digit 6 (replaced by ~):
,~,~,~,~,~,~,7,8,9,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~~,2~,~~,2~,~7,28,~9,..
Delete odd occurrences of digit 7 (replaced by ~):
,~,~,~,~,~,~,~,8,9,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~~,2~,~~,2~,~~,28,~9,..
Delete odd occurrences of digit 8 (replaced by ~):
,~,~,~,~,~,~,~,~,9,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~~,2~,~~,2~,~~,2~,~9,..
Delete odd occurrences of digit 9 (replaced by ~):
,~,~,~,~,~,~,~,~,~,10,~1,~2,13,~4,15,~6,17,~8,19,~~,2~,~2,~~,2~,~~,2~,~~,2~,~~,..
The residual digits define the sequence: 10, 1, 2, 13, 4, 15, 6, 17, 8, 19, 2, 2, 2, 2, 2,....
KEYWORD
easy,nonn,base
AUTHOR
STATUS
approved

Search completed in 0.067 seconds