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-10 of 11 results. Next

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

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

A320486 Keep just the digits of n that appear exactly once; write 0 if all digits disappear.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 0, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 0, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 0, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 0, 1, 0, 102, 103, 104, 105, 106, 107, 108, 109, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 120, 2, 1, 123, 124, 125, 126, 127, 128, 129, 130, 3
Offset: 0

Views

Author

N. J. A. Sloane, Oct 24 2018

Keywords

Comments

Digits that appear more than once in n are erased. Leading zeros are erased unless the result is 0. If all digits are erased, we write 0 for the result (A320485 is another version, which uses -1 for the empty string).
More than the usual number of terms are shown in order to reach some interesting examples.
a(n) = 0 mostly. - David A. Corneth, Oct 24 2018
The number of d-digit numbers n for which a(n) > 0 is at most d*9^d, so in this sense most a(n) are 0. - Robert Israel, Oct 24 2018
The set of numbers with the property that their digits appear at least twice is of asymptotic density 1 (and the set of numbers that have a digit that occurs only once is of density 0), so in that sense it is rather exceptional for large n to have a(n) > 0. - M. F. Hasler, Oct 24 2018

Examples

			1231 becomes 23, 1123 becomes 23, 11231 becomes 23, and 11023 becomes 23 (as we don't accept leading zeros). Note that 112323 disappears immediately and we get 0.
101, 110, 11000, 10001 all become 0.
		

References

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

Crossrefs

See A320485 for a different version.

Programs

  • Maple
    f:= proc(n) local F,S;
      F:= convert(n,base,10);
      S:= select(t -> numboccur(t,F)>1, [$0..9]);
      if S = {} then return n fi;
      F:= subs(seq(s=NULL,s=S),F);
      add(F[i]*10^(i-1),i=1..nops(F))
    end proc:
    map(f, [$0..200]); # Robert Israel, Oct 24 2018
  • Mathematica
    Table[If[(c=Select[b=IntegerDigits[n],Count[b,#]==1&])=={},0,FromDigits@c],{n,0,131}] (* Giorgos Kalogeropoulos, May 09 2021 *)
    d1[n_]:=Module[{idn=IntegerDigits[n]},FromDigits[If[DigitCount[n,10,#]>1,Nothing,#]&/@ idn]]; Array[d1,150,0] (* Harvey P. Dale, Jun 23 2023 *)
  • PARI
    a(n) = {my(d=digits(n), v = vector(10), res = 0); for(i=1,#d, v[d[i]+1]++); for(i=1,#d,if(v[d[i]+1]==1, res=10*res+d[i]));res}
    
  • PARI
    A320486(n,D=digits(n))=fromdigits(select(d->#select(t->t==d,D)<2,D)) \\ M. F. Hasler, Oct 24 2018
    
  • Python
    def A320486(n):
        return int('0'+''.join(d if str(n).count(d) == 1 else '' for d in str(n))) # Chai Wah Wu, Nov 19 2018

A321802 Delete all consecutive identical decimal digits of n; write -1 if all digits disappear.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, -1, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, -1, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, -1, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, -1, 1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 0, -1, 2, 3, 4, 5, 6, 7, 8, 9, 120, 121, 1
Offset: 0

Views

Author

Chai Wah Wu, Nov 19 2018

Keywords

Comments

Consecutive identical digits of n are erased. Leading zeros are erased unless the result is 0. If all digits are erased, we write -1 for the result (A321801 is another version, which uses 0 for the empty string).
More than the usual number of terms are shown in order to reach some interesting examples. Agrees with A320485 for n < 101.

Examples

			12311 becomes 123, 1123 becomes 23, 11231 becomes 231, and 110232 becomes 232 (as we don't accept leading zeros). Note that 112233 disappears immediately and we get -1.
1110 becomes 0 and 11000, 1100011 all become -1.
		

Crossrefs

Programs

  • Mathematica
    A321802[n_]:=With[{d=Flatten[Select[Split[IntegerDigits[n]],Length[#]==1&]]},If[d=={},-1,FromDigits[d]]];Array[A321802,100,0] (* Paolo Xausa, Nov 14 2023 *)
  • PARI
    apply( A321802(n)={if(n,forstep(i=#n=digits(n), 2, -1, n[i]!=n[i-1]&&next; if(i<3||n[i-2]!=n[i], n=n[^i]; i--); n=n[^i]); if(#n,fromdigits(n),-1))}, [0..122]) \\ M. F. Hasler, Nov 20 2018
  • Python
    from re import split
    def A321802(n):
        return (lambda x: int(x) if x != '' else -1)(''.join(d if len(d) == 1 else '' for d in split('(0+)|(1+)|(2+)|(3+)|(4+)|(5+)|(6+)|(7+)|(8+)|(9+)',str(n)) if d != '' and d != None))
    

A321012 Trajectory of 596 under repeated application of the map k -> A320486(k^2).

Original entry on oeis.org

596, 3216, 103425, 197325, 897162, 652, 2510, 631, 3986, 596, 3216, 103425, 197325, 897162, 652, 2510, 631, 3986, 596, 3216, 103425, 197325, 897162, 652, 2510, 631, 3986, 596, 3216, 103425, 197325, 897162, 652, 2510, 631, 3986, 596, 3216, 103425, 197325
Offset: 1

Views

Author

N. J. A. Sloane, Nov 04 2018

Keywords

Comments

k -> A320486(k) is Eric Angelini's remove-repeated-digits map.
Lars Blomberg has discovered that if we start with any positive integer and repeatedly apply the map k -> A320486(k^2) then we will eventually either:
- reach 0,
- reach one of the four fixed points 1, 1465, 4376, 89476 (see A321010)
- reach the period-10 cycle shown in A321011, or
- reach the period-9 cycle shown in A321012.
Since there are only finitely many possible starting values with all digits distinct, it should not be difficult to check that this is true (and indeed, Lars Blomberg may by now have completed the proof).

Examples

			The cycle of length 9 is (596, 3216, 103425, 197325, 897162, 652, 2510, 631, 3986).
		

References

  • Eric Angelini, Postings to Sequence Fans Mailing List, Oct 24 2018 and Oct 26 2018.

Crossrefs

Programs

  • Mathematica
    PadRight[{},80,{596,3216,103425,197325,897162,652,2510,631,3986}] (* Harvey P. Dale, Aug 08 2023 *)
  • PARI
    Vec(x*(596 + 3216*x + 103425*x^2 + 197325*x^3 + 897162*x^4 + 652*x^5 + 2510*x^6 + 631*x^7 + 3986*x^8) / ((1 - x)*(1 + x + x^2)*(1 + x^3 + x^6)) + O(x^40)) \\ Colin Barker, Nov 04 2018

Formula

From Colin Barker, Nov 04 2018: (Start)
G.f.: x*(596 + 3216*x + 103425*x^2 + 197325*x^3 + 897162*x^4 + 652*x^5 + 2510*x^6 + 631*x^7 + 3986*x^8) / ((1 - x)*(1 + x + x^2)*(1 + x^3 + x^6)).
a(n) = a(n-9) for n>9.
(End)

A321800 Delete the decimal digits of n that appear exactly once; write -1 if all digits disappear.

Original entry on oeis.org

-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, 11, 111, 11, 11, 11, 11, 11, 11, 11, 11, -1, 11, 22, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, 33, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, 44, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, 55, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, 66, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, 77, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, 88, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, 99
Offset: 0

Views

Author

Chai Wah Wu, Nov 19 2018

Keywords

Comments

A companion sequence to A320485.
Digits that appear exactly once in n are erased. Leading zeros are erased unless the result is 0. If all digits are erased, we write -1 for the result (A321797 is another version, which uses 0 for the empty string).
More than the usual number of terms are shown in order to reach some interesting examples.

Examples

			12321 becomes 1221, 1123 becomes 11, 11231 becomes 111, and 100223 becomes 22 (as we don't accept leading zeros). Note that 12345 disappears immediately and we get -1.
		

Crossrefs

Programs

  • Python
    def A321800(n):
        return (lambda x: int(x) if x != '' else -1)(''.join(d if str(n).count(d) != 1 else '' for d in str(n)))

A321008 a(1)=1; thereafter a(n) is obtained by applying Eric Angelini's remove-repeated-digits map, x->A320486(x), to n*a(n-1), stopping when 0 is reached.

Original entry on oeis.org

1, 2, 6, 24, 120, 720, 54, 432, 3, 30, 0
Offset: 1

Views

Author

N. J. A. Sloane, Nov 03 2018

Keywords

Examples

			a(6)=720, so for a(7) we compute 7*720 = 5040 which becomes 54 = a(7).
		

References

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

Crossrefs

A321011 Trajectory of 86 under repeated application of the map k -> A320486(k^2).

Original entry on oeis.org

86, 7396, 547816, 12985, 805, 648025, 1325, 1762, 3106, 94723, 86, 7396, 547816, 12985, 805, 648025, 1325, 1762, 3106, 94723, 86, 7396, 547816, 12985, 805, 648025, 1325, 1762, 3106, 94723, 86, 7396, 547816, 12985, 805, 648025, 1325, 1762, 3106, 94723
Offset: 1

Views

Author

N. J. A. Sloane, Nov 04 2018

Keywords

Comments

k -> A320486(k) is Eric Angelini's remove-repeated-digits map.
Lars Blomberg has discovered that if we start with any positive integer and repeatedly apply the map k -> A320486(k^2) then we will eventually either:
- reach 0,
- reach one of the four fixed points 1, 1465, 4376, 89476 (see A321010)
- reach the period-10 cycle shown in A321011, or
- reach the period-9 cycle shown in A321012.
Since there are only finitely many possible starting values with all digits distinct, it should not be difficult to check that this is true (and indeed, Lars Blomberg may by now have completed the proof).

Examples

			The cycle of length 10 is (86, 7396, 547816, 12985, 805, 648025, 1325, 1762, 3106, 94723).
		

References

  • Eric Angelini, Postings to Sequence Fans Mailing List, Oct 24 2018 and Oct 26 2018.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,0,0,0,0,0,0,0,0,1},{86,7396,547816,12985,805,648025,1325,1762,3106,94723},40] (* or *) PadRight[ {},40,{86,7396,547816,12985,805,648025,1325,1762,3106,94723}] (* Harvey P. Dale, Nov 05 2020 *)
  • PARI
    Vec(x*(86 + 7396*x + 547816*x^2 + 12985*x^3 + 805*x^4 + 648025*x^5 + 1325*x^6 + 1762*x^7 + 3106*x^8 + 94723*x^9) / ((1 - x)*(1 + x)*(1 - x + x^2 - x^3 + x^4)*(1 + x + x^2 + x^3 + x^4)) + O(x^40)) \\ Colin Barker, Nov 04 2018

Formula

From Colin Barker, Nov 04 2018: (Start)
G.f.: x*(86 + 7396*x + 547816*x^2 + 12985*x^3 + 805*x^4 + 648025*x^5 + 1325*x^6 + 1762*x^7 + 3106*x^8 + 94723*x^9) / ((1 - x)*(1 + x)*(1 - x + x^2 - x^3 + x^4)*(1 + x + x^2 + x^3 + x^4)).
a(n) = a(n-10) for n>10.
(End)

A321010 Numbers k such that f(k^2) = k, where f is Eric Angelini's remove-repeated-digits map x->A320486(x).

Original entry on oeis.org

0, 1, 1465, 4376, 89476
Offset: 1

Views

Author

N. J. A. Sloane, Nov 03 2018

Keywords

Comments

Lars Blomberg has discovered that if we start with any positive integer and repeatedly apply the map m -> A320486(m^2) then we will eventually either:
- reach 0,
- reach one of the four fixed points 1, 1465, 4376, 89476 (this sequence),
- reach the period-10 cycle shown in A321011, or
- reach the period-9 cycle shown in A321012.
From Lars Blomberg, Nov 17 2018: (Start)
Verified by testing all possible 8877690 start values that these are the only fixed points and cycles.
Detailed counts are:
- 561354 reach 0,
- 963738 reach one of the four fixed points 1, 1465, 4376, 89476 (counts 946109, 434, 17065, 130),
- 7271337 reach the period-10 cycle, and
- 81261 reach the period-9 cycle. (End)

References

  • Eric Angelini, Postings to Sequence Fans Mailing List, Oct 24 2018 and Oct 26 2018.

Crossrefs

A321009 a(1)=2; thereafter a(n) is obtained by applying Eric Angelini's remove-repeated-digits map, x->A320486(x), to n*a(n-1), stopping when 0 is reached.

Original entry on oeis.org

2, 4, 12, 48, 240, 10, 70, 560, 54, 540, 5940, 71280, 9240, 129360, 19, 304, 5168, 93024, 145, 29, 609, 198, 0
Offset: 1

Views

Author

N. J. A. Sloane, Nov 03 2018

Keywords

Examples

			a(5)=240, so for a(6) we compute 6*240 = 1440 which becomes 10 = a(6).
		

References

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

Crossrefs

Showing 1-10 of 11 results. Next