OFFSET
0,2
LINKS
Giovanni Resta, Table of n, a(n) for n = 0..10000
EXAMPLE
10 -> 1100, so a(10)=1100; 11->111, so a(11)=111.
MATHEMATICA
a[n_] := FromDigits@ Flatten[ Append[ #, Last@#] & /@ Split@ IntegerDigits[ n]]; a /@ Range[0, 46] (* Giovanni Resta, Nov 13 2018 *)
PROG
(Python)
from re import split
def A321536(n):
return int(''.join(d+d[0] for d in split('(0+)|(1+)|(2+)|(3+)|(4+)|(5+)|(6+)|(7+)|(8+)|(9+)', str(n)) if d != '' and d != None)) # Chai Wah Wu, Nov 13 2018
(PARI) a(n)={my(v=digits(n)); my(L=List()); for(i=1, #v, my(t=v[i]); if(i==1 || t<>v[i-1], listput(L, t)); listput(L, t)); fromdigits(Vec(L))} \\ Andrew Howroyd, Nov 13 2018
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Nov 13 2018
EXTENSIONS
More terms from Giovanni Resta, Nov 13 2018
STATUS
approved