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.

Previous Showing 21-30 of 40 results. Next

A319726 Write n in 9-ary, sort digits into decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 28, 37, 46, 55, 64, 73, 18, 19, 20, 29, 38, 47, 56, 65, 74, 27, 28, 29, 30, 39, 48, 57, 66, 75, 36, 37, 38, 39, 40, 49, 58, 67, 76, 45, 46, 47, 48, 49, 50, 59, 68, 77, 54, 55, 56, 57, 58, 59, 60, 69, 78, 63, 64, 65, 66, 67, 68, 69
Offset: 0

Views

Author

Seiichi Manyama, Sep 26 2018

Keywords

Crossrefs

b-ary: A073138 (b=2), A319651 (b=3), A319720 (b=4), A319722 (b=5), A319723 (b=6), A319724 (b=7), A319725 (b=8), this sequence (b=9), A004186 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Reverse[Sort[IntegerDigits[n,9]]],9],{n,0,70}] (* Harvey P. Dale, Oct 26 2022 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 9), , 4), 9); \\ Michel Marcus, Sep 26 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}
    end
    p A(9, 100)
    

Formula

n <= a(n) < 9n. - Charles R Greathouse IV, Aug 07 2024

A319720 Write n in 4-ary, sort digits into decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 9, 13, 8, 9, 10, 14, 12, 13, 14, 15, 16, 20, 36, 52, 20, 21, 37, 53, 36, 37, 41, 57, 52, 53, 57, 61, 32, 36, 40, 56, 36, 37, 41, 57, 40, 41, 42, 58, 56, 57, 58, 62, 48, 52, 56, 60, 52, 53, 57, 61, 56, 57, 58, 62, 60, 61, 62, 63, 64, 80, 144, 208, 80, 84
Offset: 0

Views

Author

Seiichi Manyama, Sep 26 2018

Keywords

Crossrefs

b-ary: A073138 (b=2), A319651 (b=3), this sequence (b=4), A319722 (b=5), A319723 (b=6), A319724 (b=7), A319725 (b=8), A319726 (b=9), A004186 (b=10).

Programs

  • Mathematica
    Table[FromDigits[ReverseSort[IntegerDigits[n, 4]], 4], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 4), , 4), 4); \\ Michel Marcus, Sep 26 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}
    end
    p A(4, 100)
    

Formula

n <= a(n) < 4n. - Charles R Greathouse IV, Aug 07 2024

A319725 Write n in 8-ary, sort digits into decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 25, 33, 41, 49, 57, 16, 17, 18, 26, 34, 42, 50, 58, 24, 25, 26, 27, 35, 43, 51, 59, 32, 33, 34, 35, 36, 44, 52, 60, 40, 41, 42, 43, 44, 45, 53, 61, 48, 49, 50, 51, 52, 53, 54, 62, 56, 57, 58, 59, 60, 61, 62, 63, 64, 72, 136, 200, 264
Offset: 0

Views

Author

Seiichi Manyama, Sep 26 2018

Keywords

Crossrefs

b-ary: A073138 (b=2), A319651 (b=3), A319720 (b=4), A319722 (b=5), A319723 (b=6), A319724 (b=7), this sequence (b=8), A319726 (b=9), A004186 (b=10).

Programs

  • Mathematica
    Table[FromDigits[ReverseSort[IntegerDigits[n, 8]], 8], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 8), , 4), 8); \\ Michel Marcus, Sep 26 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}
    end
    p A(8, 100)
    

Formula

n <= a(n) < 8n. - Charles R Greathouse IV, Aug 07 2024

A028906 Arrange digits of primes in descending order.

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 71, 91, 32, 92, 31, 73, 41, 43, 74, 53, 95, 61, 76, 71, 73, 97, 83, 98, 97, 110, 310, 710, 910, 311, 721, 311, 731, 931, 941, 511, 751, 631, 761, 731, 971, 811, 911, 931, 971, 991, 211, 322, 722, 922, 332, 932, 421, 521
Offset: 1

Views

Author

Keywords

Comments

a(n) = A004186(A000040(n)). - Reinhard Zumkeller, Apr 03 2015

Crossrefs

Programs

  • Haskell
    a028906 = a004186 . a000040  -- Reinhard Zumkeller, Apr 03 2015
  • Mathematica
    Table[FromDigits[Reverse[Sort[IntegerDigits[Prime[n]]]]],{n,60}] (* Harvey P. Dale, Sep 12 2020 *)

Extensions

More terms from Patrick De Geest, Apr 15 1998

A064222 a(0) = 0; a(n) = DecimalDigitsSortedDecreasing(a(n-1) + 1) for n > 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 22, 32, 33, 43, 44, 54, 55, 65, 66, 76, 77, 87, 88, 98, 99, 100, 110, 111, 211, 221, 222, 322, 332, 333, 433, 443, 444, 544, 554, 555, 655, 665, 666, 766, 776, 777, 877, 887, 888, 988, 998, 999, 1000, 1100, 1110, 1111, 2111
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 21 2001

Keywords

Comments

a(n) = A004186(a(n-1) + 1). - Reinhard Zumkeller, Oct 31 2007

Crossrefs

Programs

  • Haskell
    a064222 n = a064222_list !! n
    a064222_list = iterate (a004186 . (+ 1)) 0
    -- Reinhard Zumkeller, Apr 11 2012
  • Mathematica
    NestList[FromDigits[Sort[IntegerDigits[#+1],Greater]]&,0,60] (* Harvey P. Dale, Sep 04 2011 *)

Formula

a(n+1) = (d+0^d)*10^floor(log_10(a(n)+1)) + (1-0^d)*floor(a(n)/10), where d = (a(n)+1) mod 10. - Reinhard Zumkeller, Oct 31 2007
a(n) = (ceiling( (n-G(D(n)-1))/D(n) )*(10^D(n) -1) - 10^( (G(D(n)-1)-n) mod (D(n)) ) + 1)/9, for n>0, where D(n) = floor( (sqrt(8n+1)+3)/6 ) is the number of digits in a(n), and G(k) = A027468(k) = 9*k*(k+1)/2. - Stefan Alexandru Avram, May 24 2023

A352541 Number of iterations of A352544 (half if even, add largest anagram if odd) until a value is reached for the second time; 0 if this never happens.

Original entry on oeis.org

1, 2, 2, 2, 3, 2, 2, 2, 4, 2, 2, 2, 3, 4, 2, 3, 5, 5, 2, 3, 3, 2, 2, 3, 4, 3, 5, 3, 3, 5, 4, 2, 6, 2, 6, 5, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 4, 5, 5, 21, 4, 2, 6, 2, 4, 2, 4, 4, 6, 3, 5, 2, 2, 2, 7, 2, 2, 21, 7, 7, 6, 2, 4, 2, 4, 2, 5, 2, 5, 6, 5, 2, 2, 2, 3, 2, 2, 2, 4, 0, 4
Offset: 0

Views

Author

M. F. Hasler, Mar 20 2022

Keywords

Comments

A352544 is a variant of the Collatz map, where for an odd argument x, the number A004186(x) (= digits of x arranged in decreasing order) is added.
The first zero appears for initial value n = 89. See A352542 for the trajectory of n = 89. See A352540 for the indices of zeros.

Examples

			The trajectory of n = 4 is 4 -> 8 -> 16 -> 8 -> 16 -> .... The value 8 is the first one to appear for a second time after the third iteration, therefore a(4) = 3.
a(8) = 4 because the trajectory of 8 is 8 -> 4 -> 2 -> 1 -> 2 -> 1 ..., so the number 2 is the first one to appear for a second time, after the 4th iteration of the map A352544.
The trajectory of n = 49 is (49, 143, 574, 287, 1159, 10670, 5335, 10868, 5434, 2717, 10438, 5219, 14740, 7370, 3685, 12338, 6169, 15830, 7915, 17666, 8833, 17666, 8833, ...): The number 17666 is the first one to appear for a second time, after the (a(49) = 21)-st iteration.
		

Crossrefs

Cf. A352544 (half or add largest anagram), A004186 (largest anagram: arrange digits in decreasing order).
Cf. A352542 (trajectory of 89 under A352544), A352540 (indices of zeros).

Programs

  • PARI
    apply( {A352541(n,U=[n],L=200)=for(i=1,L, setsearch(U,n=A352544(n))&& return(i); U=setunion(U,[n]))}, [0..99])

Formula

a(n) = 0 iff n is in A352540.

A352542 Trajectory of initial value 89 under iterations of the map A352544: half if even, add largest anagram if odd.

Original entry on oeis.org

89, 187, 1058, 529, 1481, 9892, 4946, 2473, 9905, 19855, 118406, 59203, 154523, 708844, 354422, 177211, 949322, 474661, 1241102, 620551, 1275761, 9040972, 4520486, 2260243, 8692463, 18558895, 117444446, 58722223, 146254445, 801698866, 400849433, 1385292733, 11260625954
Offset: 0

Views

Author

M. F. Hasler, Mar 20 2022

Keywords

Comments

89 is the smallest nonnegative integer with an orbit of infinite size under iterations of x -> A352544(x) = {x/2 if x is even, x + A004186(x) if x is odd}. The list of all such numbers is given in A352540, which contains this sequence as subset.
We conjecture that there is a strictly increasing sequence (b(k), k >= 0) = (32, 37, 46, 52, 88, 91, 118, 122, 141, ...) such that all terms a(n) with n >= b(k) have more than k digits 0.
As a consequence, the sequence tends to a 10-adic limit ...27057751007.
Similarly, the number of leading digits 1 appears to grow to infinity; more precisely, a(n) has more than k leading digits 1 for all n > c(k >= 0) = (50, 70, 95, 121, 122, 123, 130, ...).

Examples

			The initial term a(0) = 89 and its successor a(1) = 187 are odd, so the number with the same digits in decreasing order, 98 resp. 871, are added to find the successor a(n+1).
Then a(2) = 1058 is even (as are a(5..6), a(10), a(13..14), ...), so the successor is obtained dividing it by two.
a(32) = 11260625954 appears to be the last even term. It appears that from this terms on, all terms have at least one digit 0 and therefore all subsequent terms end in the digit 7.
From a(37) = 11079547822507 on, all terms appear to have at least two digits 0, and therefore all end in the digits ...07.
From a(46) = 11109941625118561459007 on, all terms appear to have at least three digits 0, and therefore all end in the digits ...007.
From a(52) = 1119999530692487035860091007 on, all terms appear to have at least four digits 0, and therefore all end in the digits ...1007.
a(49) = 9999653161399504894770007 ~ 9.999653e24 appears to be the last term to have:
    (i) not more digits than the preceding term,
   (ii) its leading digit different from 1,
  (iii) a successor a(n+1) ~ 1.999965e25 ~ 2*a(n) and a(51) ~ 1.1999964e26 ~ 6*a(50).
For all n >= 51, a(n) has one more digit than a(n-1), and a(n+1) > 9*a(n).
		

Crossrefs

Cf. A352544 (the iterated map), A352540 (starting values with infinite orbit), A352541 (number of iterations until a value is repeated).

Programs

Formula

log_10 a(n) ~ n (asymptotical equivalence, as n -> oo).
a(n+1) > 9*a(n) for all n > 50. (Conjectured.)

A068637 a(n) = Max(n, R(n)), where R(n) (A004086) = digit reversal of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 31, 41, 51, 61, 71, 81, 91, 20, 21, 22, 32, 42, 52, 62, 72, 82, 92, 30, 31, 32, 33, 43, 53, 63, 73, 83, 93, 40, 41, 42, 43, 44, 54, 64, 74, 84, 94, 50, 51, 52, 53, 54, 55, 65, 75, 85, 95, 60, 61, 62, 63, 64, 65, 66, 76, 86, 96, 70, 71
Offset: 1

Views

Author

Amarnath Murthy, Feb 27 2002

Keywords

Comments

a(n) = A004186(n) for n <= 100. - Reinhard Zumkeller, Apr 03 2015

Examples

			a(12) = max(12,21) = 21. a(34632) = max(34632,23643) = 34632.
		

Crossrefs

Programs

  • Haskell
    a068637 n = max n $ a004086 n  -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    a:= n-> max(n,(s-> parse(cat(seq(s[-i], i=1..length(s)))))(""||n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 22 2015
  • Mathematica
    Table[Max[n,IntegerReverse[n]],{n,100}] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* Harvey P. Dale, Jan 10 2016 *)
  • Python
    def A068637(n): return max(n,int(str(n)[::-1])) # Chai Wah Wu, Jun 26 2025

Extensions

Wrong a(13)=22 removed by Reinhard Zumkeller, Apr 03 2015

A221714 Numbers written in base 2 with digits rearranged to be in decreasing order.

Original entry on oeis.org

0, 1, 10, 11, 100, 110, 110, 111, 1000, 1100, 1100, 1110, 1100, 1110, 1110, 1111, 10000, 11000, 11000, 11100, 11000, 11100, 11100, 11110, 11000, 11100, 11100, 11110, 11100, 11110, 11110, 11111, 100000, 110000, 110000, 111000, 110000
Offset: 0

Views

Author

Bruce L. Rothschild and N. J. A. Sloane, Jan 26 2013

Keywords

Comments

This is the base-2 equivalent of A004186.

Crossrefs

For decimal equivalents see A073138.

Programs

  • Maple
    a:= n-> parse(cat(0, sort(Bits[Split](n), `>`)[])):
    seq(a(n), n=0..36);  # Alois P. Heinz, Aug 18 2025
  • Mathematica
    a[n_] := FromDigits[-Sort[-IntegerDigits[n, 2]]] (* Giovanni Resta, Jan 27 2013 *)
  • Python
    def a(n):
         return "".join(sorted(bin(n)[2:],reverse=True)) # Indranil Ghosh, Jan 09 2017
    
  • Python
    def A221714(n): return int(bin((m:=1<>n.bit_count()))[2:]) # Chai Wah Wu, Aug 18 2025

Extensions

a(18)-a(36) from Giovanni Resta, Jan 27 2013

A352540 Values for which the iteration of A352544 (half if even, add largest anagram if odd) does not end in a loop.

Original entry on oeis.org

89, 109, 117, 137, 149, 178, 187, 203, 205, 207, 209, 213, 217, 218, 223, 225, 234, 239, 247, 253, 255, 257, 267, 273, 274, 277, 279, 293, 295, 297, 298, 299, 307, 319, 327, 335, 347, 356, 365, 374, 405, 406, 407, 409, 410, 414, 415, 418, 426, 427, 434, 436, 437, 445, 446
Offset: 1

Views

Author

M. F. Hasler, Mar 20 2022

Keywords

Comments

The iterated map A352544 is a variant of the Collatz map, A352544(x) = x/2 if x is even, A352544(x) = x + A004186(x) (add x with digits in decreasing order) if x is odd.
All the terms are only conjectured to have this property; we don't have a completely rigorous proof. But for all the listed initial terms, the trajectory quickly reaches numbers with many (>> 10) digits and grows larger with every iteration: When the number is odd and has a digit 0, then its successor is again odd and at least twice as large, most often more than 9 times larger. Roughly 1/10th of the digits are zeros, and similarly for 9s, so as the terms get larger, it becomes increasingly less probable that they could end up having no digit 0 at all, which is only a necessary condition that they might become even and not grow upon for one iteration, but still most likely resume growth immediately after. See sequence A352542, the trajectory of a(1) = 89, for an example studied in detail.

Examples

			See A352541 for examples of trajectories which end in a loop, and A352542 for the trajectory of 89 which grows to infinity.
		

Crossrefs

Cf. A352544 (iterated map: half if even, add largest anagram if odd), A352541 (number of iterations to see a value again), A352542 (trajectory of 89), A352543 (starting values ending in cycles of length > 2), A352545 (representatives of cycles of length > 2).

Programs

Formula

{ n >= 0 | A352541(n) = 0 }.
Previous Showing 21-30 of 40 results. Next