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 31-40 of 42 results. Next

A237671 Let m_n denote the number which is obtained from n-base representation of m if its digits are written in nondecreasing order; then a(n) is the smallest period of the sequence which is defined by the recurrence b(0)=0, b(1)=1, b(k)=(b(k-1) + b(k-2))_n, for k>=2, or a(n)=0, if there is no such period.

Original entry on oeis.org

1, 3, 16, 6, 20, 24, 16, 36, 120, 300, 20, 288, 28, 192, 200, 552, 180, 192, 180, 1380, 224, 60, 1728, 912, 3800, 756, 576, 1776, 4102, 15480, 3540, 1344, 10800, 14328, 800, 2304, 1520, 1890, 1232, 11280, 9040, 31152, 49544, 3660, 6360, 3696, 13248, 21408
Offset: 2

Views

Author

Keywords

Comments

We conjecture that the sequence b is always eventually periodic, and so a(n)>0.

Examples

			For n=5, b-sequence begins 0,1,1,2,3,1,4,1,1,2,... It has period {1,1,2,3,1,4} of length 6. So a(5)=6.
a(10) = 120, because the eventual period of A069638 is 120.
		

Crossrefs

Programs

  • Python
    import sympy,functools
    def digits2int(x,b):
      return functools.reduce(lambda n,d:b*n+d,x,0)
    def A237671(n):
      return next(sympy.cycle_length(lambda x:(x[1],digits2int(sorted(sympy.ntheory.factor_.digits(sum(x),n)[1:]),n)),(0,1)))[0] # Pontus von Brömssen, Aug 28 2020

A272918 Fibonacci numbers with the base 10 digits sorted into increasing order.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 13, 12, 34, 55, 89, 144, 233, 377, 16, 789, 1579, 2458, 1148, 5667, 1469, 11177, 25678, 34668, 2557, 112339, 114689, 111378, 122459, 2348, 1234669, 123789, 2345578, 257788, 2245679, 1233459, 11245778, 1368899, 23456689, 11233455, 11145568
Offset: 0

Views

Author

Alonso del Arte, May 10 2016

Keywords

Comments

Leading zeros are omitted, of course.

Examples

			a(8) = 12 because F(8) = 21, so the digits in ascending order become 12.
a(9) = 34 = F(9), the digits are already in ascending order.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[Fibonacci[n]]]], {n, 0, 49}]
  • Python
    from gmpy2 import fib
    for n in range(500):
       print(''.join(sorted(list(str(fib(n))))),end=', ')
    # Soumil Mandal, May 14 2016

Formula

a(n) = A004185(A000045(n)). - Michel Marcus, May 17 2016

A354049 The smallest number that includes all the digits of n but does not equal n.

Original entry on oeis.org

10, 10, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101, 21, 31, 41, 51, 61, 71, 81, 91, 102, 12, 122, 32, 42, 52, 62, 72, 82, 92, 103, 13, 23, 133, 43, 53, 63, 73, 83, 93, 104, 14, 24, 34, 144, 54, 64, 74, 84, 94, 105, 15, 25, 35, 45, 155, 65, 75, 85, 95, 106, 16, 26, 36, 46, 56, 166, 76, 86, 96, 107
Offset: 0

Views

Author

Keywords

Comments

The terms cannot start with a leading zero so any number including a zero must have at least one digit greater than zero as its first digit. See the examples below.

Examples

			a(9) = 19 as there is no smaller number that includes the digit 9 but does not equal 9.
a(10) = 100 as there is no smaller number that includes the digits 1 and 0 but does not equal 10. Note that '01' = 1 is not allowed.
a(20) = 102 as there is no smaller number that includes the digits 2 and 0 but does not equal 20. Note that '02' = 2 is not allowed.
a(22) = 122 as there is no smaller number that includes two 2 digits but does not equal 22.
a(200) = 1002 as there is no smaller number that includes two 0 digits and the digit 2 but does not equal 200.
		

Crossrefs

Programs

  • PARI
    vd(n) = my(d=if (n, digits(n), [0])); vector(10, k, #select(x->(x==k-1), d));
    isok(k, n, d) = if (k!=n, my(dd=vd(k)); for (i=1, #d, if (dd[i] < d[i], return(0))); return(1));
    a(n) = my(k=0, d=vd(n)); while(!isok(k, n, d), k++); k; \\ Michel Marcus, May 17 2022
    
  • Python
    def ok(k, n):
        if k == n: return False
        sk, sn = str(k), str(n)
        return all(sk.count(d) >= sn.count(d) for d in set(sn))
    def a(n):
        k = 0
        while not ok(k, n): k += 1
        return k
    print([a(n) for n in range(71)]) # Michael S. Branicky, May 23 2022

A032553 Arrange digits of cubes in ascending order.

Original entry on oeis.org

0, 1, 8, 27, 46, 125, 126, 334, 125, 279, 1, 1133, 1278, 1279, 2447, 3357, 469, 1349, 2358, 5689, 8, 1269, 1468, 11267, 12348, 12556, 15677, 13689, 12259, 23489, 27, 12799, 23678, 33579, 3349, 24578, 45666, 3556, 24578, 13599, 46
Offset: 0

Views

Author

Patrick De Geest, Apr 15 1998

Keywords

Examples

			Leading zeros discarded (e.g., 40^3 = 64000 = 00046 becomes 46).
		

Crossrefs

Programs

A068636 a(n) = Min(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, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 12, 22, 23, 24, 25, 26, 27, 28, 29, 3, 13, 23, 33, 34, 35, 36, 37, 38, 39, 4, 14, 24, 34, 44, 45, 46, 47, 48, 49, 5, 15, 25, 35, 45, 55, 56, 57, 58, 59, 6, 16, 26, 36, 46, 56, 66, 67, 68, 69, 7, 17, 27, 37, 47, 57
Offset: 1

Views

Author

Amarnath Murthy, Feb 27 2002

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • Haskell
    a068636 n = min n $ a004086 n  -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    a:= n-> min(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[Min[n,IntegerReverse[n]],{n,80}] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* Harvey P. Dale, Nov 27 2015 *)
  • Python
    def A068636(n): return min(n,int(str(n)[::-1])) # Chai Wah Wu, Jun 26 2025

A096089 Let f(n) = largest number formed using digits of n, g(n) = smallest number formed using digits of n; then a(n) = floor(f(n)/g(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 1, 2, 2, 3, 3, 4, 4, 4, 10, 1, 1, 1, 1, 2, 2, 2, 2, 3, 10, 2, 1, 1, 1, 1, 1, 1, 2, 2, 10, 2, 1, 1, 1, 1, 1, 1, 1, 1, 10, 3, 2, 1, 1, 1, 1, 1, 1, 1, 10, 3, 2, 1, 1, 1, 1, 1, 1, 1, 10, 4, 2, 1, 1, 1, 1, 1, 1, 1, 10, 4, 2, 2, 1, 1, 1, 1, 1, 1, 10, 4, 3, 2, 1, 1, 1, 1, 1, 1, 100, 10, 17, 23, 29, 34
Offset: 1

Views

Author

Amarnath Murthy, Jun 22 2004

Keywords

Examples

			a(12324) = floor(43221/12234) = 3.
a(1098) = floor(9810/0189) = 51.
		

Crossrefs

Programs

  • Maple
    A096089 := proc(n)
        floor( A004186(n)/A004185(n)) ;
    end proc: # R. J. Mathar, Jul 26 2015
  • PARI
    a(n) = d = digits(n); fromdigits(vecsort(d, , 4)) \ fromdigits(vecsort(d))

Extensions

More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Jul 19 2004
a(1)..a(9) prepended by David A. Corneth, Jan 21 2019

A057169 Least integer with the same nonzero decimal digits as n and one more 0 digit.

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 200, 102, 202, 203, 204, 205, 206, 207, 208, 209, 300, 103, 203, 303, 304, 305, 306, 307, 308, 309, 400, 104, 204, 304, 404, 405, 406, 407, 408, 409, 500, 105
Offset: 1

Views

Author

N. J. A. Sloane, Sep 15 2000

Keywords

Crossrefs

Decimal analog of A057168. Cf. A004185.

Programs

  • Maple
    f:= proc(n) local L,m,p;
    L:= convert(n,base,10);
    m:= nops(L);
    L:= sort(subs(0=NULL,L));
    p:= nops(L);
    10^m*L[1]+add(L[j]*10^(p-j),j=2..p)
    end proc:
    map(f, [$1..100]); # Robert Israel, May 06 2018

Extensions

Definition corrected by Robert Israel, May 06 2018

A135374 Mersenne numbers with digits sorted in increasing order and zeros suppressed.

Original entry on oeis.org

1, 3, 7, 15, 13, 36, 127, 255, 115, 123, 247, 459, 1189, 13368, 23677, 35556, 11137, 122346, 224578, 145578, 112579, 133449, 367888, 11256777, 13334455, 1366788, 112234777, 234455568, 11356789, 112334778, 1234446778, 2244567999
Offset: 1

Views

Author

Jonathan Vos Post, Dec 09 2007

Keywords

Comments

This is to A000225 as A078726 is to A000215. a(n) is prime for n = 2, 3, 5, 7, 15, 27, 29 and which other values?

Crossrefs

Formula

a(n) = A004185(2^n - 1) = 2^n - 1, base 10, with digits sorted in increasing order and zeros suppressed.

Extensions

Offset corrected by Arkadiusz Wesolowski, Jun 02 2011

A346296 a(0) = 1; thereafter a(n) = 2*a(n-1) + 1, with digits rearranged into nondecreasing order.

Original entry on oeis.org

1, 3, 7, 15, 13, 27, 55, 111, 223, 447, 589, 1179, 2359, 1479, 2599, 1599, 1399, 2799, 5599, 11199, 22399, 44799, 58999, 117999, 235999, 147999, 259999, 159999, 139999, 279999, 559999, 1119999, 2239999, 4479999, 5899999, 11799999, 23599999, 14799999, 25999999
Offset: 0

Views

Author

Ctibor O. Zizka, Jul 13 2021

Keywords

Examples

			a(3) = A004185(2*7+1) = A004185(15) = 15.
a(4) = A004185(2*15+1) = A004185(31) = 13.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := a[n] = FromDigits @ Sort @ IntegerDigits[2*a[n - 1] + 1]; Array[a, 45, 0] (* Amiram Eldar, Jul 13 2021 *)
    NestList[FromDigits[Sort[IntegerDigits[2#+1]]]&,1,40] (* Harvey P. Dale, Oct 01 2023 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = fromdigits(vecsort(digits(2*va[n-1]+1)));); va;} \\ Michel Marcus, Aug 31 2021
    
  • Python
    from itertools import accumulate
    def atis(anm1, _): return int("".join(sorted(str(2*anm1+1))))
    print(list(accumulate([1]*39, atis))) # Michael S. Branicky, Aug 31 2021

Formula

a(n) = A004185(2*a(n-1)+1).
For k >= 1;
a(12*k-9) = 100^(k-1) * 16 - 1;
a(12*k-8) = 100^(k-1) * 14 - 1;
a(12*k-7) = 100^(k-1) * 28 - 1;
a(12*k-6) = 100^(k-1) * 56 - 1;
a(12*k-5) = 100^(k-1) * 112 - 1;
a(12*k-4) = 100^(k-1) * 224 - 1;
a(12*k-3) = 100^(k-1) * 448 - 1;
a(12*k-2) = 100^(k-1) * 590 - 1;
a(12*k-1) = 100^(k-1) * 1180 - 1;
a(12*k) = 100^(k-1) * 2360 - 1;
a(12*k+1) = 100^(k-1) * 1480 - 1;
a(12*k+2) = 100^(k-1) * 2600 - 1.
G.f.: -(1800*x^15 -720*x^14 +1080*x^13 -1080*x^12 -590*x^11 -142*x^10 -224*x^9 -112*x^8 -56*x^7 -28*x^6 -14*x^5 +2*x^4 -8*x^3 -4*x^2 -2*x -1) / ((x-1)*(10*x^6-1)*(10*x^6+1)). - Alois P. Heinz, Aug 02 2021
a(n) = 100*a(n-12) + 99 for n >= 15. - Pontus von Brömssen, Sep 01 2021

A348287 Arrange nonzero digits of n in increasing order then append the zeros.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 22, 23, 24, 25, 26, 27, 28, 29, 30, 13, 23, 33, 34, 35, 36, 37, 38, 39, 40, 14, 24, 34, 44, 45, 46, 47, 48, 49, 50, 15, 25, 35, 45, 55, 56, 57, 58, 59, 60, 16, 26, 36, 46, 56, 66
Offset: 0

Views

Author

Simon Strandgaard, Oct 10 2021

Keywords

Comments

Shares 101 initial terms with A328447. First difference is A328447(101)=101 vs A348287(101)=110.

Examples

			a(1010) = 1100,
a(1234567890) = 1234567890,
a(9876543210) = 1234567890.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := 10^DigitCount[n, 10, 0] * FromDigits[Sort[IntegerDigits[n]]]; Array[a, 100, 0] (* Amiram Eldar, Oct 10 2021 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n), x->if(x,x,10)));
    
  • Python
    def a(n): s = str(n); return int("".join(sorted(s)))*10**s.count('0')
    print([a(n) for n in range(68)]) # Michael S. Branicky, Oct 10 2021
  • Ruby
    p Array.new(40) { |n|
      n.to_s.gsub('0','a').split(//).sort.join.gsub('a','0').to_i
    }
    
Previous Showing 31-40 of 42 results. Next