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

A293869 Square array whose n-th row lists all numbers having n as a substring, n >= 1; read by falling antidiagonals.

Original entry on oeis.org

1, 10, 2, 11, 12, 3, 12, 20, 13, 4, 13, 21, 23, 14, 5, 14, 22, 30, 24, 15, 6, 15, 23, 31, 34, 25, 16, 7, 16, 24, 32, 40, 35, 26, 17, 8, 17, 25, 33, 41, 45, 36, 27, 18, 9, 18, 26, 34, 42, 50, 46, 37, 28, 19, 10, 19, 27, 35, 43, 51, 56, 47, 38, 29, 100, 11
Offset: 1

Views

Author

M. F. Hasler, Oct 18 2017

Keywords

Examples

			The array starts:
   [ 1  10  11  12  13  14  15  16  17  18  19  21  31 ...] = A011531
   [ 2  12  20  21  22  23  24  25  26  27  28  29  32 ...] = A011532
   [ 3  13  23  30  31  32  33  34  35  36  37  38  39 ...] = A011533
   [ 4  14  24  34  40  41  42  43  44  45  46  47  48 ...] = A011534
   [ 5  15  25  35  45  50  51  52  53  54  55  56  57 ...] = A011535
   [ 6  16  26  36  46  56  60  61  62  63  64  65  66 ...] = A011536
   [ 7  17  27  37  47  57  67  70  71  72  73  74  75 ...] = A011537
   [ 8  18  28  38  48  58  68  78  80  81  82  83  84 ...] = A011538
   [ 9  19  29  39  49  59  69  79  89  90  91  92  93 ...] = A011539
   [10 100 101 102 103 104 105 106 107 108 109 110 210 ...] = A293870
   [11 110 111 112 113 114 115 116 117 118 119 211 311 ...] = A293871
   [12 112 120 121 122 123 124 125 126 127 128 129 212 ...] = A293872
   [   ...             ...             ...             ...]
		

Crossrefs

Cf. A072484, A292690 (variant starting with row 0).
Cf. A292451, A292731 (both partially coincide with row 11, but no inclusion relation holds).

Programs

  • Mathematica
    Block[{d = 15, q, a, s}, a = Table[q = n-1; s = IntegerString[n]; Table[While[StringFreeQ[IntegerString[++q], s]]; q, d-n+1], {n, d}]; Table[a[[n, k-n+1]], {k, d}, {n, k}]] (* Paolo Xausa, Mar 01 2024 *)
  • PARI
    has=(n,p,m=10^#Str(p))->until(p>n\=10,n%m==p&&return(1))
    Mat(vectorv(12,n,a=[];for(k=n,oo,has(k,n)||next;a=concat(a,k);#a>12&&break);a))
    
  • Perl
    See Links section.

Formula

T(n, k) = A072484(n, k) for any n > 0 and k = 1..n. - Rémy Sigrist, Jan 29 2021

A272215 a(n) = that number formed by permuting the digits of n which is divisible by the highest power of 2 (in case of a tie, choose the smallest number).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 22, 32, 24, 52, 26, 72, 28, 92, 30, 13, 32, 33, 34, 35, 36, 37, 38, 39, 40, 14, 24, 34, 44, 54, 64, 74, 48, 94, 50, 15, 52, 35, 54, 55, 56, 57, 58, 59, 60, 16, 26, 36, 64, 56, 66, 76, 68, 96, 70, 17, 72, 37, 74, 57, 76, 77, 78, 79, 80, 18, 28, 38
Offset: 1

Views

Author

David A. Corneth, Apr 22 2016

Keywords

Comments

There is no reason to allow permutations that begin with 0, because we can always gain a power of 2 by putting that zero at the other end. - N. J. A. Sloane, Apr 23 2016

Examples

			The numbers obtained by permuting the digits of 1336 are 1336, 1363, 1633, 3136, 3163, 6133, 3316, 3613, 6313, 3361, 3631 and 6331. The highest power of 2 dividing any of these is 2^6, which divides just one of them, 3136, so a(1336) = 3136.
		

Crossrefs

Programs

  • Mathematica
    hp2[n_]:=Module[{c={#,IntegerExponent[#,2]}&/@(FromDigits/@ Permutations[ IntegerDigits[ n]]),mx},mx=Max[c[[All,2]]];Min[Select[c,#[[2]]==mx&][[All,1]]]]; Array[hp2,90] (* Harvey P. Dale, Jan 27 2020 *)

A076084 Consider all numbers that can be formed by permuting the digits of n; take those with the greatest number of divisors; a(n) is the smallest of them.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 91, 20, 12, 22, 32, 24, 52, 26, 72, 28, 92, 30, 13, 32, 33, 34, 35, 36, 37, 38, 39, 40, 14, 24, 34, 44, 54, 64, 74, 84, 94, 50, 15, 52, 35, 54, 55, 56, 75, 58, 95, 60, 16, 26, 36, 64, 56, 66, 76, 68, 96, 70, 17, 72
Offset: 1

Views

Author

Amarnath Murthy, Oct 07 2002

Keywords

Examples

			a(24)=a(42) = 24. a(61) = 16.
From the numbers found by permuting the digits 1138, we get 1138, 1183, 1318, 1381, 1813, 1831, 3118, 3181, 3811, 8113, 8131 and 8311. We find that 8113 has the most divisors of those, namely 8. Therefore a(1138) = 8113. - _David A. Corneth_, Apr 22 2016
		

Crossrefs

Cf. A261370.

Programs

  • Mathematica
    pdn[n_]:=Module[{c=SortBy[{#,DivisorSigma[0,#]}&/@FromDigits/@ Permutations[ IntegerDigits[n]],Last],m},m=c[[-1,2]];Min[Transpose[ Select[c,#[[2]]==m&]][[1]]]]; Array[pdn,80] (* Harvey P. Dale, Nov 29 2013 *)

Extensions

More terms from David Wasserman, Mar 24 2005

A274125 Numbers having digits in nondecreasing order and sum of digits greater than or equal to the product of digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 123, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1122, 1123, 1124, 11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11122
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Intersection of A062996 and A009994. Permuting the digits of the terms of this sequence gives A254621. Permutations of digits can be found in A261370. The union of A254621 and A011540 is A062996.

Crossrefs

Programs

  • Mathematica
    upto[nd_] := Sort[FromDigits /@ Reverse /@ Select[ Flatten[ IntegerPartitions[#, nd, Range@ 9] & /@ Range[9 nd], 1], Times @@ # <= Plus @@ # &]]; upto[8] (* Giovanni Resta, Jun 20 2016 *)
  • PARI
    is(n) = my(d=digits(n)); prod(i=1, #d, d[i]) <= vecsum(d) && vecsort(d) == d

A274126 Numbers with digits larger than 1 sorted by product of digits minus sum of digits, then by size.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 22, 23, 24, 222, 25, 33, 26, 27, 34, 223, 28, 29, 35, 44, 224, 2222, 36, 233, 37, 45, 225, 38, 46, 226, 39, 55, 234, 2223, 47, 227, 333, 56, 48, 228, 235, 244, 2224, 22222, 49, 57, 229, 66, 236, 334, 2233, 58, 67, 245, 2225, 237, 59, 68, 335
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Let PS(n) be product of digits of n minus sum of digits of n (=-A062329(n)). Then a(n) is PS(A037344(m)) ordered by PS(n) for values of m such that A037344 has its digits in nondecreasing order. If PS(m) some nonzero term m of A002276 exceed some bound, all positive integers t larger than that term without zeros and ones exceed have a larger value for PS(t).
Prepending -A062329(a(n)) or more ones before a(n) gives terms of A274125.
Permuting digits of A274125 gives A254621. Permutations of digits can be found in A261370. The union of A254621 and A011540 is A062996. The b-file lists terms having PS(n) <= 10^6.

Examples

			Suppose we want to order the nondecreasing integers without zeros and ones up to PS(m) = 50. We see that 222222 has PS(222222) = 52, so we only have to check such nondecreasing integers up to 222222. Not all of those must be checked, which is used in the program.
25 is a term. Prepending PS(25) = -A062329(25) = 3 ones before 25 gives 11125, which is a term of A274125. Permuting digits of 11125 gives for example 12511, which is a term of A254621.
		

Crossrefs

Programs

  • PARI
    See program in link "PARI program".

A319154 a(n) is the smallest nonnegative integer not yet in the sequence that starts with the ending digit of a(n-1); a(1)=0; initial zeros are dropped.

Original entry on oeis.org

0, 1, 10, 2, 20, 3, 30, 4, 40, 5, 50, 6, 60, 7, 70, 8, 80, 9, 90, 11, 12, 21, 13, 31, 14, 41, 15, 51, 16, 61, 17, 71, 18, 81, 19, 91, 100, 22, 23, 32, 24, 42, 25, 52, 26, 62, 27, 72, 28, 82, 29, 92, 200, 33, 34, 43, 35, 53, 36, 63, 37, 73, 38, 83, 39, 93, 300, 44, 45, 54
Offset: 1

Views

Author

Enrique Navarrete, Sep 25 2018

Keywords

Comments

Theorem: Every nonnegative number appears.
Proof: (Sketched by Enrique Navarrete, Sep 25 2018; completed by N. J. A. Sloane, Oct 27 2018)
(i) Sequence is infinite (dG, G=giant number, is always available)
(ii) As usual for these "lexicographically earliest distinct term sequences", for any k, there is a threshold n_k such that for all n > n_k, a(n) > k.
(iii) Some final digit (d, say) appears infinitely often. (Otherwise sequence would be finite.) If d=0, go to step (vi).
(iv) All numbers beginning with d appear (If dm were missing, find xd in sequence which is > dm and also > n_{dm}. Then term after xd would be dm, contradiction.)
(v) In particular, all numbers dm0 appear.
(vi) After a number ending in 0, the next number is the smallest missing number. So if x is missing, find dm0 > n_x, then the next term would be (0)x = x, a contradiction. QED

Examples

			a(2) = 1 since it is formed from a(1) = 0 as 01 = 1.
a(20) = 11 since it is the smallest number not yet in the sequence that starts with the ending digit 0 of a(19) = 90.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], If[# == 0, True, First@ IntegerDigits@ k == #] &@ Mod[#[[-1]], 10]], k++]; k]] &, {0}, 69] (* Michael De Vlieger, Oct 15 2018 *)
  • PARI
    nexta(v, x) = {my(d = x % 10, newa); for (i=0, oo, newa = eval(concat(Str(d), Str(i))); if (! vecsearch(v, newa), return (newa)););}
    lista(nn) = {lasta = 0; print1(lasta, ", "); va = [lasta]; for (n=1, nn, newa = nexta(va, lasta); print1(newa, ", "); va = vecsort(concat(va, newa)); lasta = newa;);} \\ Michel Marcus, Oct 15 2018
Showing 1-6 of 6 results.