login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A216587 Preimage of n for A216556 (i.e., concatenation of digits of a(n), each increased by 1, yields n), -1 if there is none. 5
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

Also: Left inverse to A216556: A216587 o A216556 = id.

Sequence A216589 lists the indices n for which a(n)=-1, i.e., n is not in the range of A216556.

LINKS

Table of n, a(n) for n=0..74.

E. Angelini, Strings resurrection, SeqFan mailing list, Sep 08 2012

FORMULA

a(A216556(n))=n for all n.

a(n)=n-1 for n < 11; a(n)=n-11 for 20 < n < 110 except n=30, 40, ..., 100.

a(n)=-1 if n contains a substring "20", "30",..., "90" or "00", or if n starts with digits "11", "12", ..., "19". For all other n>1 one has a(n)>0.

EXAMPLE

a(a(a(2127)))=a(a(1016))=a(905)=-1, since under A216556, 905 -> 1016 -> 2127, but no n yields A216556(n)=905.

PROG

(PARI) A216587(n)={my(s=0); n!=1&for(i=1, #n=Vecsmall(Str(n)), n[i]>48||(i>1&n[i-1]==49&s=s\10+1)||return(-1); (s=s*10+n[i]-49)&next; (i<#n&n[i++]==48&s=9)||return(-1)); s}

CROSSREFS

See also A216557.

Sequence in context: A121042 A000030 A179635 * A174210 A134777 A253015

Adjacent sequences:  A216584 A216585 A216586 * A216588 A216589 A216590

KEYWORD

sign,base,easy

AUTHOR

M. F. Hasler, Sep 09 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 20 21:53 EST 2018. Contains 299387 sequences. (Running on oeis4.)