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.

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

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 636, 1272, 25, 50, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 636, 1272, 25, 50, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 636, 1272, 25, 50
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2019, following a suggestion from Yukun Yao

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 A323831.
The number of steps to reach 0, 1, or 5 is given in A323832.

Examples

			After a(15) = 32768 we get 65536 which becomes 636 after deleting "55". Then doubling 636 we get 1272, then 2544 which becomes 25 after deleting "44", then 50, then 100 which becomes 1 after deleting "00", and now the sequence repeats.
		

Crossrefs

See A035615 for a classic related base-2 sequence.

Programs

  • Mathematica
    dad[n_]:=FromDigits[FixedPoint[Flatten[Select[Split[#],Length[#]==1&]]&,IntegerDigits[2n]]];NestList[dad,1,100] (* Paolo Xausa, Nov 14 2023 *)
  • PARI
    Vec((1 + 2*x)*(1 + 4*x^2 + 16*x^4 + 64*x^6 + 256*x^8 + 1024*x^10 + 4096*x^12 + 16384*x^14 + 636*x^16 + 25*x^18) / (1 - x^20) + O(x^40)) \\ Colin Barker, Feb 03 2019

Formula

From Colin Barker, Feb 03 2019: (Start)
G.f.: (1 + 2*x)*(1 + 4*x^2 + 16*x^4 + 64*x^6 + 256*x^8 + 1024*x^10 + 4096*x^12 + 16384*x^14 + 636*x^16 + 25*x^18) / (1 - x^20).
a(n) = a(n-20) for n>19.
(End)
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

A306305 Smallest number m such that 2^m*n has 2 or more identical adjacent decimal digits or -1 if no such m exists.

Original entry on oeis.org

16, 15, 11, 14, 17, 10, 4, 13, 4, 16, 0, 9, 7, 3, 12, 12, 5, 3, 12, 15, 4, 0, 7, 8, 2, 6, 11, 2, 2, 11, 5, 11, 0, 4, 5, 2, 5, 11, 7, 14, 9, 3, 3, 0, 5, 6, 2, 7, 8, 1, 9, 5, 6, 10, 0, 1, 1, 1, 1, 10, 1, 4, 4, 10, 8, 0, 5, 3, 3, 4, 4, 1, 4, 4, 2, 10, 0, 6, 7, 13
Offset: 1

Views

Author

Chai Wah Wu, Feb 14 2019

Keywords

Comments

a(n) is smallest m such that 2^m*n is in the sequence A171901 (or -1 if no such m exists).
If n is not 0, 1, or 5, then a(n) <= A323832(n).
Conjecture 1: a(n) != -1 for all n > 0.
Conjecture 2: there exists K > 0 such that a(n) <= K for all n. Evidence suggests K = 21.
From Chai Wah Wu, Feb 19 2019 : (Start)
The above conjectures are true. In particular, 0 <= a(n) <= 21 for all n > 0. This is proved by showing that for each 0 < n < 1000, there is a number m <= 21 such that 2^m*n mod 1000 has adjacent identical digits. If n > 0 and n == 0 mod 1000, then clearly a(n) = 0.
(End)

Examples

			a(1) = 16 since 2^16 = 65536 has 2 adjacent digits '5' and no smaller power of 2 has adjacent identical digits.
Record values:
a(1) = 16
a(5) = 17
a(15913) = 19
a(79565) = 20
a(6703845) = 21
		

Crossrefs

Programs

  • Python
    def A306305(n):
        m, k = 0, n
        while True:
            s = str(k)
            for i in range(1,len(s)):
                if s[i] == s[i-1]:
                    return m
            m += 1
            k *= 2

Formula

a(A171901(n)) = 0.
If n is not a multiple of 5, then a(5*n) is either 0 or a(n) + 1. This is because 2*(5*n) = 10*n is just n appended with a 0 and has a similar trajectory under successive doubling.

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

A323835 Start with n and repeatedly double it and apply the "delete multiple digits" map m -> A320485(m); a(n) is the number of steps needed to reach either 0 or 1, or -1 if neither 0 nor 1 is ever reached.

Original entry on oeis.org

0, 0, 27, 12, 26, 41, 11, 31, 25, 4, 40, 1, 10, 37, 30, 43, 24, 35, 3, 42, 39, 15, 1, 20, 9, 2, 36, 26, 29, 13, 42, 32, 23, 1, 34, 44, 2, 18, 41, 21, 38, 45, 14, 15, 1, 45, 19, 2, 8, 30, 1, 20, 35, 2, 25, 1, 28, 27, 12, 26, 41, 1, 31, 43, 22, 34, 5, 20, 33, 30
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2019

Keywords

Comments

The first values of k for which a(k) = -1 are 91, 182, 364, 455, 728, 910, 1456, 1729, 1820, 1853, 1879. - Giovanni Resta, Feb 04 2019
From Chai Wah Wu, Feb 04 2019: (Start)
a(n) <= 64 for all n.
Let f(n) = A320486(2*n) and k = 9876543210. If n > k/2, then f(n) <= k. Note that a(n) = a(f(n)) + 1 if a(f(n)) >= 0 and a(n) = -1 if a(f(n)) = -1.
If k/2 < n <= k, then f(n) <= n*198/1000 < k/2. Thus if n > k, f(f(n)) <= k/2.
This means that we only need to study trajectories for 0 <= n <= k. The longest trajectories in this range have 64 steps and are reached by the 9 numbers 1233546907, 1323546907, 1335246907, 1335467407, 1335469072, 1335469207, 1335471907, 1337046907, 2133546907. The first application of f(.) takes all these numbers to the number 26709381, which then follows 63 steps to 1. Since these 9 numbers all have a double digit 3, they are not in the range of f and thus not part of a longer trajectory. Thus for all n > k, a(f(n)) <= 63, and a(n) <= 64.
There are 74801508 numbers in the range 0 <= n <= k such that a(n) = -1.
(End)
All trajectories will reach one of four cycles: 0, 1, 91, or 910. - Chai Wah Wu, Feb 11 2019

Examples

			As we can see from A320487, 2 reaches 1 in 27 steps: 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, so a(2)=27.
		

Crossrefs

Programs

  • Python
    def A323835(n):
        mset, m, c = set(), n, 0
        while True:
            if m == 0 or m == 1:
                return c
            m = int('0'+''.join(d if str(2*m).count(d) == 1 else '' for d in str(2*m)))
            if m in mset:
                return -1
            mset.add(m)
            c += 1  # Chai Wah Wu, Feb 04 2019

Extensions

More terms from David Consiglio, Jr., Feb 04 2019

A306384 Start with n and repeatedly double it and apply the "delete any run of identical digits" operation described in A321801; 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, 6, 20, 3
Offset: 0

Views

Author

Chai Wah Wu, Feb 12 2019

Keywords

Comments

Similar to A323832, but is different in that at each step, the "delete any run of identical digits" operation (A321801) is apply only once here, whereas in A323832, at each step after doubling the number, the operation A321801 is applied repeatedly until the number does not change any longer. The first term which differs from A323832 is a(66).
Conjecture: every number will eventually reach one of 0, 1, or 5.
Conjecture is true for n < 10^10.
2404877 takes 123 steps to reach 5 and is the largest value for a(n) for n < 10^7.
79620527 takes 131 steps to reach 5 and is the largest value for a(n) for n < 10^8.
769237841 takes 138 steps to reach 5 and is the largest value for a(n) for n < 10^9.
The numbers 4807736476 and 4807736509 both take 142 steps to reach 5 and this is the largest value for a(n) for n < 10^10.

Examples

			a(66) = 6: 66->132->264->528->1056->22->0. Contrast this with A323832(66) = 5: 66->132->264->528->1056->0.
		

Crossrefs

Programs

  • Python
    from re import split
    def A306384(n):
        mset, m, c = set(), n, 0
        while True:
            if m == 1 or m == 0 or m == 5:
                return c
            m = int('0'+''.join(d for d in split('(0+)|(1+)|(2+)|(3+)|(4+)|(5+)|(6+)|(7+)|(8+)|(9+)', str(2*m)) if d != '' and d != None and len(d) == 1))
            if m in mset:
                return -1
            mset.add(m)
            c += 1
Showing 1-5 of 5 results.