cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

A216557 Number of iterations of A216556 until the initial value n appears as a substring of the iterate; 0 if this will never happen.

Original entry on oeis.org

10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 19, 28, 37, 46, 55, 64, 73, 82, 90, 0, 9, 19, 28, 37, 46, 55, 64, 73, 82, 0, 89, 9, 19, 28, 37, 46, 55, 64, 73, 0, 79, 89, 9, 19, 28, 37, 46, 55, 64, 0, 69, 79, 89, 9, 19, 28, 37, 46, 55, 0, 59, 69, 79, 89, 9, 19, 28, 37, 46, 0, 49, 59, 69, 79, 89, 9, 19, 28, 37, 0, 39, 49, 59, 69, 79, 89, 9, 19, 28, 0, 29, 39, 49, 59, 69, 79
Offset: 0

Views

Author

M. F. Hasler, Sep 08 2012

Keywords

Comments

Can someone prove (and maybe strengthen) the following conjecture: a(n) = 0 whenever A216587(m) = -1 for all m obtained by concatenating any digit to the left and any digit to the right of n.
From Lars Blomberg, Jan 01 2020: (Start)
The nonzero a(n) take only 18 different values: (9, 10, 19, 28, 29, 37, 39, 46, 49, 55, 59, 64, 69, 73, 79, 82, 89, 90). For n < 10^12 the corresponding counts are (108, 75, 829, 388, 306, 326, 302, 289, 291, 277, 303, 265, 315, 254, 327, 245, 339, 2). Specifically a(19) = a(210) = 90.
Nonzero terms are becoming increasingly sparse. For k = 1..12 the number of nonzero a(n) for n < 10^k is (10, 92, 247, 489, 797, 1194, 1678, 2236, 2860, 3565, 4359, 5421). (End)

Examples

			a(211) = 9 since under the action of A216556, 211 -> 322 -> 433 -> 544 -> 655 -> 766 -> 877 -> 988 -> 1099 -> 211010, which contains the substring 211.
a(111) = 0 since if some number has "111" as its substring, then its preimage for A216556 (cf. A216587) contains at least the substring "00" (e.g., A216587(21110) = 1009), and has in turn no preimage under A216556. Therefore 111 cannot occur as a substring in the orbit of any number under A216556.
		

Crossrefs

See A216603 for the list of n such that a(n) = 0. - M. F. Hasler, Sep 09 2012

Programs

  • PARI
    A216557(n, L=9e9, f)={my(s=Mod(n,10^#Str(n)), t=n); n && until(20>t\=10, t%1000%111||return; t%10 || t%100==10 || return); for(i=1,L, t=n=A216556(n); until(!t\=10, s==t && return(i))); f} \\ 3rd (optional) argument f allows to specify a return value (e.g., f=[] or -1) in case no result is found within the limit of L iterations. If the zero result is deduced from the initial value (cf. FORMULA) the function returns an empty result (which also evaluates to 0). [PARI syntax updated Jan 02 2020]

Formula

a(n)=0 for all numbers having "20", "30", ..., "90" or "00" or "111", "222", ... "999" as a substring.

Extensions

Corrected typo in a(69): 4 -> 46 by Lars Blomberg, Jan 01 2020

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.

Original entry on oeis.org

-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
Offset: 0

Views

Author

M. F. Hasler, Sep 09 2012

Keywords

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.

Examples

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

Crossrefs

See also A216557.

Programs

  • 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}

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.

A216589 Numbers n which don't have a preimage for A216556, i.e., such that A216587(n)=-1.

Original entry on oeis.org

0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148
Offset: 1

Views

Author

M. F. Hasler, Sep 09 2012

Keywords

Comments

Concretely, numbers having "20", "30", ..., "90" or "00" as a substring, or starting with "11", "12", ... "19", and the number 0.
Note that A216557 does not necessarily yield 0 for these numbers, e.g., 10 has no preimage for A216556, but 210 does have, and 10 -> 21 -> ... -> 98 -> 109.

Programs

  • PARI
    is_A216589(n)={n || return(1); n=Vec(Str(n)); n[1]<"2" & 1<#n & n[2]>"0" & return(1); for(i=2,#n, n[i]=="0" || next; n[i-1]=="1" || return(1))}

Formula

A216587(n)=-1 if and only if n is in this sequence.

A216603 Indices n for which A216557(n)=0, i.e., n does not reappear as substring in its orbit under A216556.

Original entry on oeis.org

20, 30, 40, 50, 60, 70, 80, 90, 100, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159
Offset: 1

Views

Author

M. F. Hasler, Sep 09 2012

Keywords

Comments

E. Angelini asked on the SeqFan list whether n=127 is in this sequence. The proof of the affirmative answer was given in the second reply to the post. (But "Lemma 2" should read: There is no n in the range of A216556 such that ...". Indeed, 2016,...,9016 also yield 127 as substring, but are not in A216556.) The same reasoning can be applied to terms 122,...,129.

Examples

			The number 0 is not in this sequence, because repeated application of A216556 yields 0 > 1 > ... > 9 > 10 which contains 0 as substring, after A216557(0)=10 iterations.
a(1)=20 is the least number which does not occur as a substring in its orbit under A216556. This is the case since no term in (the range of) A216556 may have "20" as a substring.
As explained in A216556 (and obvious from the definition), the digit "0" can only occur preceded by the digit "1". This also explains a(2)=30 through a(9)=100.
In A216557 it is explained why a(10)=111 and all numbers having this or 222,...,999 as substring are in this list.
To see why a(11)=112 and the following terms are in this list, observe that 112 itself has no preimage under A216556 (cf. A216587), and consider all possibilities for "patterns" in which it might occur: Obviously not followed by a digit 0, but possibly by a digit among 1,...,9; and maybe preceded by a digit among 2,...,9. However, all these cases lead to a preimage which has "00" as substring, and is therefore not in the range of A216556.
		

Crossrefs

A337016 a(0) = 0. Successive terms are double the previous, then with their digits incremented by 1.

Original entry on oeis.org

0, 1, 3, 7, 25, 61, 233, 577, 2265, 5641, 22393, 55897, 2228105, 5567321, 22245753, 555102617, 2221316345, 55537437101, 222185985313, 5554821081737, 222110753274585, 5553326176510281, 22217763464131673, 555466371039374457, 222110438531898591025
Offset: 0

Views

Author

Jamie Robert Creasey, Nov 21 2020

Keywords

Comments

If 9 appears anywhere in the decimal expansion of 2*a(n-1), we replace that digit with 10 upon incrementing by 1. See a(12) of the Examples section and A216556 for more information.

Examples

			To calculate a(12), double 55897 to get 111794, then increment the digits by 1 to get 2228105.
To calculate a(13), double 2228105 to get 4456210, then increment the digits by 1 to get 5567321.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, (l-> parse(cat(seq(
          l[-i]+1, i=1..nops(l)))))(convert(2*a(n-1), base, 10)))
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Dec 12 2020
  • Mathematica
    NestList[FromDigits[Flatten@ Map[IntegerDigits, IntegerDigits[2 #] + 1]] &, 0, 24] (* Michael De Vlieger, Dec 11 2020 *)
  • PARI
    digs(n) = if (n==0, [0], digits(n));
    lista(nn) = {a = 0; print1(a, ", "); for (n=1, nn, a = eval(concat(apply(t->Str(t+1), digs(2*a)))); print1(a, ", "););} \\ Michel Marcus, Nov 28 2020

Formula

a(n) = A216556(2*a(n-1)), a(0) = 0.
Showing 1-5 of 5 results.