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 41-50 of 85 results. Next

A305714 Number of finite sequences of positive integers of length n that are polydivisible and strictly pandigital.

Original entry on oeis.org

1, 1, 1, 2, 0, 0, 2, 0, 1, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Jun 08 2018

Keywords

Comments

A sequence q of length k is strictly pandigital if it is a permutation of {1,2,...,k}. It is polydivisible if Sum_{i = 1...m} 10^(m - i) * q_i is a multiple of m for all 1 <= m <= k.

Examples

			Sequence of sets of n-digit numbers that are weakly polydivisible and strictly pandigital is (with A = 10):
  {0}
  {1}
  {12}
  {123,321}
  {}
  {}
  {123654,321654}
  {}
  {38165472}
  {381654729}
  {381654729A}
		

Crossrefs

A321682 Numbers with distinct digits in factorial base.

Original entry on oeis.org

0, 1, 2, 4, 5, 10, 13, 14, 19, 20, 22, 23, 46, 67, 68, 77, 82, 85, 86, 101, 106, 109, 110, 115, 116, 118, 119, 238, 355, 356, 461, 466, 469, 470, 503, 526, 547, 548, 557, 562, 565, 566, 623, 646, 667, 668, 677, 682, 685, 686, 701, 706, 709, 710, 715, 716, 718
Offset: 1

Views

Author

Rémy Sigrist, Nov 16 2018

Keywords

Comments

This sequence is a variant of A010784; however here we have infinitely many terms (for example all the terms of A033312 belong to this sequence).

Examples

			The first terms, alongside the corresponding factorial base representations, are:
  n   a(n)  fac(a(n))
  --  ----  ---------
   1     0        (0)
   2     1        (1)
   3     2      (1,0)
   4     4      (2,0)
   5     5      (2,1)
   6    10    (1,2,0)
   7    13    (2,0,1)
   8    14    (2,1,0)
   9    19    (3,0,1)
  10    20    (3,1,0)
  11    22    (3,2,0)
  12    23    (3,2,1)
  13    46  (1,3,2,0)
  14    67  (2,3,0,1)
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) local r; `if`(n (l-> is(nops(l)=nops({l[]})))(b(n, 2)):
    select(t, [$0..1000])[];  # Alois P. Heinz, Nov 16 2018
  • Mathematica
    q[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; UnsameQ @@ s]; Select[Range[0, 720], q] (* Amiram Eldar, Feb 21 2024 *)
  • PARI
    is(n) = my (s=0); for (k=2, oo, if (n==0, return (1)); my (d=n%k); if (bittest(s,d), return (0), s+=2^d; n\=k))

A342383 a(0) = 0; for n > 0, a(n) is the least positive integer not occurring earlier such that both the digits in a(n) and the digits in a(n-1)+a(n) are all distinct.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 6, 8, 9, 10, 13, 12, 14, 15, 16, 18, 17, 19, 20, 21, 24, 23, 25, 26, 27, 29, 28, 30, 31, 32, 35, 34, 36, 37, 38, 40, 39, 41, 42, 43, 46, 45, 47, 48, 49, 53, 50, 52, 51, 54, 69, 56, 64, 59, 61, 62, 58, 65, 60, 63, 57, 67, 68, 70, 72, 71, 74, 73, 75, 78, 76, 80, 79, 81, 82, 83
Offset: 0

Views

Author

Scott R. Shannon, Mar 09 2021

Keywords

Comments

The sequence is finite due to the finite number of positive integers with distinct digits, see A010784, although the exact number of terms is currently unknown.

Examples

			a(1) = 1 as 1 has one distinct digit and a(0)+1 = 0+1 = 1 which has one distinct digit 0.
a(6) = 7 as 7 has one distinct digit and a(5)+7 = 5+7 = 12 which has two distinct digits. Note that 6 is the first skipped number as a(5)+6 = 5+6 = 11 has 1 as a duplicate digit.
a(11) = 13 as 13 has two distinct digits and a(10)+13 = 10+13 = 23 which has two distinct digits. Note that 11 and 12 are skipped as 11 has 1 as a duplicate digit while a(10)+12 = 10+12 = 22 has 2 as a duplicate digit.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {0}, k, m = 10^4}, Do[k = 1; While[Nand[FreeQ[a, k], AllTrue[DigitCount[a[[-1]] + k], # < 2 &], AllTrue[DigitCount[k], # < 2 &]], If[k > m, Break[]]; k++]; If[k > m, Break[]]; AppendTo[a, k], {i, 76}]; a] (* Michael De Vlieger, Mar 11 2021 *)
  • Python
    def agen():
      alst, aset = [0], {0}
      yield 0
      while True:
        an = 1
        while True:
          while an in aset: an += 1
          stran, t = str(an), str(alst[-1] + an)
          if len(stran) == len(set(stran)) and len(t) == len(set(t)):
            alst.append(an); aset.add(an); yield an; break
          an += 1
    g = agen()
    print([next(g) for n in range(77)]) # Michael S. Branicky, Mar 11 2021

A343921 The maximum number of times a positive number can be added to n such that the digits in each resulting sum are distinct.

Original entry on oeis.org

36, 9, 12, 13, 12, 11, 15, 12, 11, 26, 14, 13, 23, 11, 11, 13, 26, 11, 12, 12, 13, 23, 14, 11, 24, 12, 13, 35, 25, 12, 12, 16, 13, 12, 12, 11, 13, 11, 17, 12, 13, 12, 15, 9, 12, 12, 25, 9, 14, 22, 12, 23, 12, 25, 34, 11, 11, 13, 22, 11, 16, 12, 14, 12, 12, 24, 13, 13, 15, 12, 13, 10, 11, 11, 9
Offset: 0

Views

Author

Scott R. Shannon, May 04 2021

Keywords

Comments

See A338659 for the smallest positive number that can be added to n a total of a(n) times such that the digits in each resulting sum are distinct.
See A343922 for the largest positive number that can be added to n a total of a(n) times such that the digits in each resulting sum are distinct.

Examples

			a(8) = 11 as A338659(8) = A343922(8) = 150 can be added to 8 a total of 11 times with each sum containing distinct digits. The sums are 158, 308, 458, 608, 758, 908, 1058, 1208, 1358, 1508, 1658. No other positive number can be added to 8 a total of 11 or more times to produce such sums.
		

Crossrefs

Formula

a(n) = 0 for n >= 9876543210.

A355301 Normal undulating numbers where "undulating" means that the alternate digits go up and down (or down and up) and "normal" means that the absolute differences between two adjacent digits may differ.

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, 101, 102, 103, 104, 105, 106, 107, 108, 109, 120, 121, 130, 131, 132, 140, 141, 142, 143, 150
Offset: 1

Views

Author

Bernard Schott, Jun 27 2022

Keywords

Comments

This definition comes from Patrick De Geest's link.
Other definitions for undulating are present in the OEIS (e.g., A033619, A046075).
When the absolute differences between two adjacent digits are always equal (e.g., 85858), these numbers are called smoothly undulating numbers and form a subsequence (A046075).
The definition includes the trivial 1- and 2-digit undulating numbers.
Subsequence of A043096 where the first different term is A043096(103) = 123 while a(103) = 130.
This sequence first differs from A010784 at a(92) = 101, A010784(92) = 102.
The sequence differs from A160542 (which contains 100). - R. J. Mathar, Aug 05 2022

Examples

			111 is not a term here, but A033619(102) = 111.
a(93) = 102, but 102 is not a term of A046075.
Some terms: 5276, 918230, 1053837, 263915847, 3636363636363636.
Are not terms: 1331, 594571652, 824327182.
		

Crossrefs

Cf. A059168 (subsequence of primes).
Differs from A010784, A241157, A241158.

Programs

  • Maple
    isA355301 := proc(n)
        local dgs,i,back,forw ;
        dgs := convert(n,base,10) ;
        if nops(dgs) < 2 then
            return true;
        end if;
        for i from 2 to nops(dgs)-1 do
            back := op(i,dgs) -op(i-1,dgs) ;
            forw := op(i+1,dgs) -op(i,dgs) ;
            if back*forw >= 0 then
                return false;
            end if ;
        end do:
        back := op(-1,dgs) -op(-2,dgs) ;
        if back = 0 then
            return false;
        end if ;
        return true ;
    end proc:
    A355301 := proc(n)
        option remember ;
        if n = 1 then
            0;
        else
            for a from procname(n-1)+1 do
                if isA355301(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A355301(n),n=1..110) ; # R. J. Mathar, Aug 05 2022
  • Mathematica
    q[n_] := AllTrue[(s = Sign[Differences[IntegerDigits[n]]]), # != 0 &] && AllTrue[Differences[s], # != 0 &]; Select[Range[0, 100], q] (* Amiram Eldar, Jun 28 2022 *)
  • PARI
    isok(m) = if (m<10, return(1)); my(d=digits(m), dd = vector(#d-1, k, sign(d[k+1]-d[k]))); if (#select(x->(x==0), dd), return(0)); my(pdd = vector(#dd-1, k, dd[k+1]*dd[k])); #select(x->(x>0), pdd) == 0; \\ Michel Marcus, Jun 30 2022

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

A085451 Numbers n such that n and prime[n] together use only distinct digits.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 17, 19, 20, 21, 24, 25, 27, 28, 35, 39, 40, 45, 53, 57, 58, 60, 61, 69, 70, 72, 79, 85, 89, 90, 91, 93, 96, 98, 104, 108, 120, 124, 145, 146, 147, 150, 162, 236, 237, 253, 254, 259, 315, 316, 359, 380, 384, 390, 405, 406, 460, 461, 518
Offset: 1

Views

Author

Zak Seidov, Jul 01 2003

Keywords

Comments

There are exactly 101 such numbers in the sequence. Numbers with distinct digits in A010784. Primes with distinct digits in A029743. The case n and n^2 (exactly 22 numbers) in A059930.
A178788(A045532(a(n))) = 1. [From Reinhard Zumkeller, Jun 30 2010]

Examples

			3106 is in the sequence (and the last term) because it and prime[3106]=28549 together use all 10 distinct digits.
		

Crossrefs

Programs

  • Mathematica
    bb = {}; Do[idpn = IntegerDigits[Prime[n]]; idn = IntegerDigits[n]; If[Length[idn] + Length[idpn] == Length[Union[idn, idpn]], bb = {bb, n}], {n, 1, 100000}]; Flatten[bb]

A107846 Number of duplicate digits of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0
Offset: 0

Views

Author

Rick L. Shepherd, May 24 2005

Keywords

Comments

a(A010784(n)) = 0; a(A109303(n)) > 0. - Reinhard Zumkeller, Jul 09 2013

Examples

			a(11) = 1 because 11 has two total decimal digits but only one distinct digit (1) and 2-1=1.
Similarly, a(3653135) = 7 (total digits) - 4 (distinct digits: 1,3,5,6) = 3 (There are three duplicate digits here, namely, 3, 3 and 5).
		

Crossrefs

Cf. A055642 (Total decimal digits of n), A043537 (Distinct decimal digits of n).

Programs

  • Haskell
    import Data.List (sort, group)
    a107846 = length . concatMap tail . group . sort . show :: Integer -> Int
    -- Reinhard Zumkeller, Jul 09 2013
    
  • Mathematica
    Table[Total[Select[DigitCount[n]-1,#>0&]],{n,0,120}] (* Harvey P. Dale, Jul 31 2013 *)
  • Python
    def a(n): return len(s:=str(n)) - len(set(s))
    print([a(n) for n in range(105)]) # Michael S. Branicky, Jan 09 2023

Formula

a(n) = A055642(n) - A043537(n).

A241157 Numbers in which the two least-significant digits are distinct.

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, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110
Offset: 1

Views

Author

N. J. A. Sloane, Apr 18 2014

Keywords

Comments

More than the usual number of terms are displayed in order to show the difference from some closely-related sequences.

Crossrefs

Programs

  • Haskell
    a241157 n = a241157_list !! (n-1)
    a241157_list = 0 : filter f [0..] where
       f x = d' /= d where d' = mod x' 10; (x', d) = divMod x 10
    -- Reinhard Zumkeller, May 02 2014

A241158 Numbers in which the two leading (most significant) digits are distinct.

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, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 120
Offset: 1

Views

Author

N. J. A. Sloane, Apr 18 2014

Keywords

Comments

More than the usual number of terms are displayed in order to show the difference from some closely-related sequences.

Crossrefs

Programs

Previous Showing 41-50 of 85 results. Next