A322000 Nonnegative integers, sorted by increasing value of A028897(n) = Sum d[i]*2^i for n = Sum d[i]*10^i, then value of n.
0, 1, 2, 10, 3, 11, 4, 12, 20, 100, 5, 13, 21, 101, 6, 14, 22, 30, 102, 110, 7, 15, 23, 31, 103, 111, 8, 16, 24, 32, 40, 104, 112, 120, 200, 1000, 9, 17, 25, 33, 41, 105, 113, 121, 201, 1001, 18, 26, 34, 42, 50, 106, 114, 122, 130, 202, 210, 1002, 1010, 19, 27
Offset: 0
Examples
The first terms of the sequence are as follows: (b = A028897) n | 0 | 1 | 2 | 10 | 3 | 11 | 4 | 12 | 20 | 100 | 5 | 13 | 21 | 101 | ... ----+---+---+---+----+---+----+---+----+----+-----+---+----+----+-----+----- b(n)| 0 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 4 | 4 | 5 | 5 | 5 | 5 | ... For example, b(345) = 3*2^2 + 4*2 + 5 = 25.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- Robin C. Yu, Decibinary Numbers, on Hackerrank.com.
Programs
-
Maple
N:= 30: # for all numbers with A028897(n) <= N L:= {seq([i,i],i=0..9)}: Agenda:= {seq([i,i],i=1..9)}: extend:= proc(p) local x; op(select(t -> t[2]<=N, [seq([10*p[1]+x, 2*p[2]+x],x=0..9)])); end proc: sorter:= proc(p1,p2) if p1[2] <> p2[2] then p1[2] < p2[2] else p1[1] < p2[1] fi end proc: while Agenda <> {} do Agenda:= map(extend, Agenda); L:= L union Agenda; od: L:= sort( convert(L,list),sorter): map(t -> t[1], L); # Robert Israel, Feb 24 2019
-
PARI
my(A028897(n)=fromdigits(digits(n),2),S=[]);for(k=1,2^10,(t=A028897(k))>9||S=setunion(S,[[t,k]]));apply(t->t[2],S)
Comments