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”).
%I #7 Jul 28 2015 12:45:27
%S 1,1,1,1,1,1,1,1,1,1,12,12,21,21,21,21,21,21,21,21,12,12,12,21,21,21,
%T 21,21,21,21,12,12,12,12,21,21,21,21,21,21,12,12,12,12,12,21,21,21,21,
%U 21,12,12,12,12,12,12,21,21,21,21,12,12,12,12,12
%N Concatenate the positions of digits 9, 8,..., 0 in the decimal representation of n, using 1 for the leftmost digit etc., skip digits which don't occur.
%e Consider n=1103: the digit '3' is at the 4th position (looking from the left), digit '1' is in 1st and 2nd place, digit '0' is at 3rd position, digits 2 and 4-9 do not occur. Thus a(1103) = 4123.
%o (PARI) a(n)={my(p=vector(10));for(i=1,#n=if(n,digits(n),[0]),p[n[i]+1]=if(p[n[i]+1],concat(p[n[i]+1],i),i));if(1<#p=concat(Vecrev(select(t->#t,p))),p[1]=Str(p[1]);eval(concat(p)),p)}
%Y Cf. A260526 - A260529 and A260519 - A260522 for variants; A045918 for the classical "look and say" sequence.
%K nonn,base
%O 0,11
%A _M. F. Hasler_, Jul 28 2015