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-4 of 4 results.

A323832 Start with n and repeatedly double it and apply the "repeatedly delete any run of identical digits" operation described in A323830; a(n) is the number of steps needed to reach one of 0, 1, or 5, or -1 if none of these three numbers is ever reached.

Original entry on oeis.org

0, 0, 19, 12, 18, 0, 11, 23, 17, 4, 19, 1, 10, 29, 22, 32, 16, 5, 3, 47, 18, 15, 1, 20, 9, 2, 28, 26, 21, 13, 31, 24, 15, 1, 4, 23, 2, 18, 46, 21, 17, 51, 14, 15, 1, 24, 19, 2, 8, 10, 1, 33, 27, 24, 25, 1, 20, 19, 12, 18, 30, 1, 23, 7, 14, 29, 5, 20, 3
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2019

Keywords

Comments

Conjecture: every number will eventually reach one of 0, 1, or 5.
From Chai Wah Wu, Feb 04 2019, Feb 13 2019: (Start)
Conjecture is true for n < 10^10.
1604466 takes 115 steps to reach 5 and is the largest value for a(n) for n < 10^7.
91070713 takes 121 steps to reach 5 and is the largest value for a(n) for n < 10^8.
126591463 and 801282051 both take 128 steps to reach 5 and this is the largest value for a(n) for n < 10^9.
The numbers 1582393271, 1582393293, 4645106705 all take 131 steps to reach 5 and this is the largest value for a(n) for n < 10^10.
(End)

Examples

			Starting with 2, the trajectory is 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 636, 1272, 25, 50, 1, reaching 1 in 20 steps, so a(2) = 20.
3 reaches 1 in 12 steps: 3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 61, 1, so a(3) = 12.
10 reaches 5 in 19 steps: 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, 6360, 12720, 250, 5, so a(10) = 19.
		

Crossrefs

Programs

  • Python
    from re import split
    def A321801(n):
        return int('0'+''.join(d for d in split('(0+)|(1+)|(2+)|(3+)|(4+)|(5+)|(6+)|(7+)|(8+)|(9+)',str(n)) if d != '' and d != None and len(d) == 1))
    def f(n):
        x = 2*n
        y = A321801(x)
        while x != y:
            x, y = y, A321801(y)
        return x
    def A323832(n):
        mset, m, c = set(), n, 0
        while True:
            if m == 1 or m == 0 or m == 5:
                return c
            m = f(m)
            if m in mset:
                return -1
            mset.add(m)
            c += 1 # Chai Wah Wu, Feb 04 2019, Feb 11 2019

A320487 a(0) = 1; thereafter a(n) is obtained by applying the "delete multiple digits" map m -> A320485(m) to 2*a(n-1).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 61, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 61, 1
Offset: 0

Views

Author

N. J. A. Sloane, Oct 24 2018, following a suggestion from Eric Angelini

Keywords

Comments

In short, double the previous term and delete any digits appearing more than once.
Periodic with period 28.
Using the variant A320486 yields the same sequence, since the empty string never occurs. - M. F. Hasler, Oct 24 2018
Conjecture: If we start with any nonnegative integer and repeatedly double and apply the "delete multiple digits" map m -> A320485(m), we eventually reach 0 or 1 (see A323835). - N. J. A. Sloane, Feb 03 2019

Examples

			2*32768 = 65536 -> 3 since we delete the multiple digits 6 and 5.
2*61 = 122 -> 1 since we delete the multiple 2's.
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Oct 24 2018

Crossrefs

See A035615 for a classic related base-2 sequence.

Programs

  • Mathematica
    a[0] = 1;a[n_] := a[n] = FromDigits[First /@ Select[ Tally[IntegerDigits[2 a[n - 1]]], #[[2]] == 1 &]];Table[a[n], {n, 0, 56}] (* Stan Wagon, Nov 17 2018 *)
  • PARI
    A=[2];for(i=1,99,A=concat(A,A320486(A[#A]*2)));A \\ M. F. Hasler, Oct 24 2018

A035615 Number of winning length n strings with a 2-symbol alphabet in "same game".

Original entry on oeis.org

1, 0, 2, 2, 6, 12, 26, 58, 126, 278, 602, 1300, 2774, 5878, 12350, 25778, 53470, 110332, 226610, 463602, 945214, 1921550, 3896642, 7885092, 15927086, 32121582, 64697726, 130166378, 261637446, 525478668, 1054673162, 2115601450, 4241716734, 8501080838, 17031744170
Offset: 0

Views

Author

Keywords

Comments

Strings that can be reduced to null string by repeatedly removing an entire run of two or more consecutive symbols.

Examples

			11011001 is a winning string since 110{11}001 -> 11{000}1 -> {111} -> null.
		

Crossrefs

See A309874 for the losing strings.
For some similar questions in base 10, see A323830, A323831, A320487. - N. J. A. Sloane, Feb 04 2019
Row b=2 of A323844.

Programs

  • Mathematica
    Join[{1}, Rest[CoefficientList[Series[x (2x^6 - 6x^5 + 8x^4 + 2x^3 - 6x^2 + 2x)/((1 - x^2)(1 - 2x)(1 - x - x^2)^2), {x, 0, 40}], x]]] (* or *) Join[{1}, LinearRecurrence[{4, -2, -8, 6, 6, -3, -2}, {0, 2, 2, 6, 12, 26, 58}, 40]] (* Harvey P. Dale, Sep 26 2012 *)
  • PARI
    a(n)=if(n, ([0,1,0,0,0,0,0; 0,0,1,0,0,0,0; 0,0,0,1,0,0,0; 0,0,0,0,1,0,0; 0,0,0,0,0,1,0; 0,0,0,0,0,0,1; -2,-3,6,6,-8,-2,4]^(n-1)*[0;2;2;6;12;26;58])[1,1], 1) \\ Charles R Greathouse IV, Jun 15 2015

Formula

G.f.: x(2x^6 - 6x^5 + 8x^4 + 2x^3 - 6x^2 + 2x)/[(1 - x^2)(1 - 2x)(1 - x - x^2)^2] (conjectured). - Ralf Stephan, May 11 2004. Established by Burns and Purcell - see link.
a(0) = 1, a(1) = 0, a(2) = 2, a(3) = 2, a(4) = 6, a(5) = 12, a(6) = 26, a(7) = 58, a(n) = 4*a(n-1) - 2*a(n-2) - 8*a(n-3) + 6*a(n-4) + 6*a(n-5) - 3*a(n-6) - 2*a(n-7). - Harvey P. Dale, Sep 26 2012
a(n) = 2^n - 2 * n * Fibonacci(n-2) - (-1)^n - 1 for n >= 2 (proved by Burns and Purcell (2005, 2007)). - Petros Hadjicostas, Jul 04 2018

Extensions

More terms from Naohiro Nomoto, Jul 09 2001
Further terms from Sascha Kurz, Oct 19 2001
a(27)-a(36) from Robert Price, Apr 08 2019

A323831 a(0) = 5; thereafter a(n) is obtained by doubling a(n-1) and repeatedly deleting any string of identical digits.

Original entry on oeis.org

5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, 6360, 12720, 250, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, 6360, 12720, 250
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2019

Keywords

Comments

Periodic with period length 20.
Conjecture: If we start with any nonnegative number, and repeatedly double it and apply the "repeatedly delete any run of identical digits" operation described here, we eventually reach one of 0, 1, or 5.
In other words, the conjecture is that eventually we reach 0 or join the trajectory shown here or the trajectory shown in A323830.
The number of steps to reach 0, 1, or 5 is given in A323832.

Crossrefs

Programs

  • Mathematica
    dad[n_]:=FromDigits[FixedPoint[Flatten[Select[Split[#],Length[#]==1&]]&,IntegerDigits[2n]]];NestList[dad,5,100] (* Paolo Xausa, Nov 14 2023 *)

Formula

a(n+1) = A321801(2*a(n)). For general numbers, the "repeatedly delete any run of identical digits" operation corresponds to repeatedly applying A321801. - Chai Wah Wu, Feb 11 2019
Showing 1-4 of 4 results.