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

A010784 Numbers with distinct decimal digits.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

More than the usual number of terms are displayed in order to show the difference from some closely related sequences.
Also: a(1) = 0; a(n) = Min{x integer | x > a(n-1) and all digits to base 10 are distinct}.
This sequence is finite: a(8877691) = 9876543210 is the last term; a(8877690) = 9876543201. The largest gap between two consecutive terms before a(249999) = 2409653 is 104691, as a(175289) = 1098765, a(175290) = 1203456. - Reinhard Zumkeller, Jun 23 2001
Complement of A109303. - David Wasserman, May 21 2008
For the analogs in other bases b, search for "xenodromes." A001339(b-1) is the number of base b xenodromes for b >= 2. - Rick L. Shepherd, Feb 16 2013
A073531 gives the number of positive n-digit numbers in this sequence. Note that it does not count 0. - T. D. Noe, Jul 09 2013
Can be seen as irregular table whose n-th row holds the n-digit terms; length of row n is then A073531(n) = 9*9!/(10-n)! except for n = 1 where we have 10 terms, unless 0 is considered to belong to a row 0. - M. F. Hasler, Dec 10 2018

Crossrefs

Subsequence of A043096.
Cf. A109303, A029740 (odds), A029741 (evens), A029743 (primes), A001339.

Programs

  • Haskell
    a010784 n = a010784_list !! (n-1)
    a010784_list = filter ((== 1) . a178788) [1..]
    -- Reinhard Zumkeller, Sep 29 2011
    
  • Mathematica
    Select[Range[0,100], Max[DigitCount[#]] == 1 &] (* Harvey P. Dale, Apr 04 2013 *)
  • PARI
    is(n)=my(v=vecsort(digits(n)));v==vecsort(v,,8) \\ Charles R Greathouse IV, Sep 17 2012
    
  • PARI
    select( is(n)=!n||#Set(digits(n))==logint(n,10)+1, [0..120]) \\ M. F. Hasler, Dec 10 2018
    
  • PARI
    apply( A010784_row(n,L=List(if(n>1,[])))={forvec(d=vector(n,i,[0,9]),forperm(d,p,p[1]&&listput(L,fromdigits(Vec(p)))),2);Set(L)}, [1..2]) \\ A010784_row(n) returns all terms with n digits. - M. F. Hasler, Dec 10 2018
    
  • Python
    A010784_list = [n for n in range(10**6) if len(set(str(n))) == len(str(n))] # Chai Wah Wu, Oct 13 2019
    
  • Python
    # alternate for generating full sequence
    from itertools import permutations
    afull = [0] + [int("".join(p)) for d in range(1, 11) for p in permutations("0123456789", d) if p[0] != "0"]
    print(afull[:100]) # Michael S. Branicky, Aug 04 2022
    
  • Scala
    def hasDistinctDigits(n: Int): Boolean = {
      val numerStr = n.toString
      val digitSet = numerStr.split("").toSet
      numerStr.length == digitSet.size
    }
    (0 to 99).filter(hasDistinctDigits) // Alonso del Arte, Jan 09 2020

Formula

A178788(a(n)) = 1; A178787(a(n)) = n; A043537(a(n)) = A055642(a(n)). - Reinhard Zumkeller, Jun 30 2010
A107846(a(n)) = 0. - Reinhard Zumkeller, Jul 09 2013

Extensions

Offset changed to 1 and first comment adjusted by Reinhard Zumkeller, Jun 14 2010

A204454 Odd numbers not divisible by 11.

Original entry on oeis.org

1, 3, 5, 7, 9, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 123, 125, 127, 129, 131
Offset: 1

Views

Author

Wolfdieter Lang, Jan 24 2012

Keywords

Comments

Up to a(45) this sequence coincides with A029740, but 101 is not in A029740.
This sequence is the fourth member of the family of sequences of odd numbers not divisible by a given odd prime p. For p = 3, 5, and 7 these sequences are A007310, A045572, and A162699, respectively. The formula is
a(p;n) = 2*n+1 + 2*floor((n-(p+1)/2)/(p-1)), n>=1, p an odd prime. If one puts a(p;0):=0, the o.g.f. is
G(p;x) = (x/((1-x^(p-1))*(1-x)))*(1 + 2*sum(x^k,k=1..(p-3)/2) + 4*x^((p-1)/2) + 2*sum(x^((p-1)/2+k),k=1..(p-3)/2) + x^(p-1)).
See the array A204456 with the coefficients of the numerator polynomials of these o.g.f.s.
This sequence gives also the numbers relatively prime to 2 and 11.
Another formula is a(p;n) = 2*n-1 + 2*floor(( n-(p-3)/2)/(p-1)), n>=1. From the rows of the array A204456 for the o.g.f. one can show first: a(p;n) = n + sum(floor((n+p-3-k)/(p-1)),k=1..(p-3)/2) + 3*floor((n+(p-3)/2)/(p-1)) + sum(floor((n+(p-3)/2-k)/(p-1)),k=1..(p-1)/2), p an odd prime, n>=1. - Wolfdieter Lang, Jan 26 2012
Recurrences for odd p: a(p;n) = a(p;n-(p-1)) + 2*p. For first differences: a(p;n) = a(p;n-1) + a(p;n-p+1) - a(p;n-p), n>=p, and inputs a(p;0):=-1 (here not 0) and a(p;k) for k=1,...,p-1. See the formula sections of the A-numbers for the instances p = 3, 5, and 7 for the contributions from Zak Seidov and R. J. Mathar. From this recurrence follows the o.g.f. (starting with x^1) directly. Above it has been found from the formula for a(p;n). Here the coefficients of the numerator polynomial of the o.g.f. (besides the 1s for x^1 and x^p) arise as first differences of the input members of the {a(p;n)} sequence. - Wolfdieter Lang, Jan 27 2012
Numbers coprime to 22. The asymptotic density of this sequence is 5/11. - Amiram Eldar, Oct 20 2020

Examples

			2*floor((n-6)/10), n>=0, is the sequence (the exponent of a number indicates how many times this number appears consecutively): (-2)^6 0^10 2^10 4^10 ... By adding these numbers to 2*n+1, n>=0, one obtains -1 for n=0 and a(n) for n>=1. The o.g.f is computed from this sum, but adjusted such that one obtains a vanishing a(0).
Recurrences: 31 = a(15) = a(5) + 2*11 = 9 + 22. a(15) = a(14) + a(5) - a(4) = 29 + 9 - 7 = 31. - _Wolfdieter Lang_, Jan 27 2012
		

Crossrefs

Programs

Formula

a(n) = 2*n+1 + 2*floor((n-6)/10), n>=1. Note that this is -1 for n=0, but the following o.g.f. uses a(0)=0.
O.g.f: x*(1+2*x+2*x^2+2*x^3+2*x^4+4*x^5+2*x^6+2*x^7+2*x^8+2*x^9+x^10)/((1-x^10)*(1-x)). See the comment above for p=11.
a(n) = n + sum(floor((n+9-k)/10),k=1..4) + 3*floor((n+4)/10) + sum(floor((n+4-k)/10),k=1..5) = n + (n-1) + 2*floor((n+4)/10), n>=1. See the line m=5, p=11 of the array A204456, and the general formula given in a comment above. - Wolfdieter Lang, Jan 26 2012
Recurrences: a(n) = a(n-10) + 2*11. First differences: a(n) = a(n-1) + a(n-10) - a(n-11), n>=11, and inputs a(p;0):=-1 ( here not 0) and a(p;k) for k=1,...,10. See the general comment above. - Wolfdieter Lang, Jan 27 2012

A029741 Even numbers with distinct digits.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 90, 92, 94, 96, 98, 102, 104, 106, 108, 120, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 146
Offset: 1

Views

Author

Keywords

Comments

Largest term is 9876543210. - Alonso del Arte, Jan 09 2020
There are 4493646 terms. - Michael S. Branicky, Aug 04 2022

Crossrefs

Cf. A029740 (odd version). Union of that sequence with this sequence gives A010784.

Programs

  • Mathematica
    Select[2Range[0, 79], Max[DigitCount[#]] == 1 &] (* Harvey P. Dale, Dec 23 2013 *)
  • Python
    # generates full sequence
    from itertools import permutations
    afull = [0] + sorted(set(int("".join(p)) for d in range(1, 11) for p in permutations("0123456789", d) if p[0] != "0" and p[-1] in "02468"))
    print(afull[:100]) # Michael S. Branicky, Aug 04 2022
  • Scala
    def hasDistinctDigits(n: Int): Boolean = {
      val numerStr = n.toString
      val digitSet = numerStr.split("").toSet
      numerStr.length == digitSet.size
    }
    (0 to 198 by 2).filter(hasDistinctDigits) // Alonso del Arte, Jan 09 2020
    

Extensions

Offset changed to 1 by Michael S. Branicky, Aug 04 2022
Showing 1-3 of 3 results.