|
|
A176853
|
|
Given a(n) as d digits in length, partition the binary representation of a(n) into d-digit numbers from left to right and add them as if they were decimal numbers.
|
|
1
|
|
|
1, 1, 2, 1, 2, 2, 3, 1, 2, 20, 21, 11, 12, 21, 22, 10, 11, 11, 12, 20, 21, 21, 22, 11, 12, 12, 13, 21, 22, 22, 23, 10, 11, 20, 21, 11, 12, 21, 22, 20, 21, 30, 31, 21, 22, 31, 32, 11, 12, 21, 22, 12, 13, 22, 23, 21, 22, 31, 32, 22, 23, 32, 33, 10, 11, 11, 12, 20, 21, 21, 22, 11
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
a(9) = 2 because binary(9) = "1001" and 1+0+0+1=2.
a(10)= 20 because binary(10) = "1010" and 10+10=20.
a(31)= 23 because binary(31) = "11111" and 11+11+1=23.
a(100)= 120 because binary(100)= "1100100" and 110+010+0=120.
Note that several a(n) are equivalent to n: [1,20,21,1212,1213,10310,10311].
|
|
MATHEMATICA
|
f[n_]:=Module[{id=IntegerDigits[n, 2], len=IntegerLength[n]}, Total[ FromDigits/@ Partition[ IntegerDigits[ n, 2], len, len, {1, 1}, {}]]]; Array[f, 80] (* Harvey P. Dale, Jun 19 2018 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|