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 11-20 of 35 results. Next

A261370 Permutation of nonnegative integers where a number having digits in nondescending order is followed by all numbers having the same digits arranged in increasing order.

Original entry on oeis.org

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

Views

Author

David A. Corneth, Aug 17 2015

Keywords

Comments

If a number contains a zero, then some permutation will yield a number with a leading zero, which is already in the sequence without the leading zero. So that permutation is not included. For example, 102 contains a zero, so 012 and 021 are permutations of these numbers' digits. But they are actually 12 and 21, which are already in the sequence. This leaves 120, 201 and 210 to be added to the sequence after 102.
From Rémy Sigrist, May 01 2017 : (Start)
- This sequence is to base 10 what A187769 is to base 2,
- Beyond the initial 0, this sequence can be seen as an irregular table, where the n-th row corresponds to the permutation class of A179239(n).
(End)

Crossrefs

Programs

  • Mathematica
    a = {0}; f[n_] := Block[{w = Sort@ Permutations@ IntegerDigits@ n}, w = Delete[w, Position[First /@ w, 0]]]; Do[If[! MemberQ[a, n], AppendTo[a, FromDigits /@ f@ n]], {n, 105}]; DeleteDuplicates@ Flatten@ a (* Michael De Vlieger, Sep 07 2015 *)

A378564 a(n) is the number of n-digit nonnegative integers with the median of the digits equal to one of the digits.

Original entry on oeis.org

10, 9, 900, 1665, 90000, 232710, 9000000, 29055165, 900000000, 3413319138, 90000000000, 386095933170, 9000000000000, 42568084276236, 900000000000000, 4607838122919165, 90000000000000000, 491998811785538730, 9000000000000000000, 51983526276872387430, 900000000000000000000, 5447302810160797285236
Offset: 1

Views

Author

Stefano Spezia, Dec 01 2024

Keywords

Examples

			From _David A. Corneth_, Dec 03 2024: (Start)
a(3) = 900 as every positive integer between (inclusive) 100 and 999 contains its median. The median is the middle digit after sorting which is in the digits.
a(4) = 1665. For example 2558 has digits sorted and the median, 5 is in the digits of 2558 and any permutation of digits of 2558. There are 12 such permutations so 2558 contributes 12 towards the total of a(4).
0258 has digits sorted (but a leading 0) and has 24 permutations. To account for the leading 0 we remove it and deduce the number of permutations from what is left, namely 258. That has 6 permutations. So in total 0258 adds 24 - 6 = 18 towards the total of a(4). (End)
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=If[OddQ[n], KroneckerDelta[n,1]+9*10^(n-1), Module[{c=0}, For[k=10^(n-1), k<=10^n-1, k++, If[MemberQ[digits=IntegerDigits[k], Median[digits]], c++]]; c]]; Array[a, 7]
  • PARI
    \\ See Corneth link
    
  • Python
    from math import prod, factorial
    from itertools import combinations_with_replacement
    from collections import Counter
    def A378564(n):
        if n==1: return 10
        if n&1: return 9*10**(n-1)
        c, f = 0, factorial(n-1)
        for p in combinations_with_replacement(range(10),n):
            if max(p):
                a = sorted(p)
                b = a[len(a)-1>>1]+a[len(a)>>1]
                if b&1^1 and b>>1 in p:
                    v = Counter(d for d in p if d).values()
                    s = sum(v)
                    q = prod((factorial(i) for i in v))*factorial(n-s)
                    c += sum(f*i//q for i in v)
        return c # Chai Wah Wu, Dec 14 2024

Formula

a(2*n-1) = 9*10^(n-1) with a(1) = 10.
a(n) = A063945(n) for n odd.

Extensions

More terms from David A. Corneth, Dec 03 2024

A090056 Numbers k divisible by at least one nontrivial permutation (rearrangement) of the digits of k, excluding all permutations that result in digit loss.

Original entry on oeis.org

3105, 7128, 7425, 8316, 8712, 9513, 9801, 30105, 31050, 37125, 42741, 44172, 67128, 70416, 71208, 71253, 71280, 71328, 71928, 72108, 72441, 74142, 74250, 74628, 74925, 78912, 79128, 80712, 81816, 82755, 83160, 83181, 83916, 84510, 85725, 86712, 87120, 87132, 87192, 87912
Offset: 1

Views

Author

Chuck Seggelin, Nov 21 2003

Keywords

Comments

Trivial permutations are identified as those where the permutation = k itself. Digit loss occurs when a permutation has 0 in the most significant position, which drops off, leaving a number with fewer digits. For example, when k is 3105, the permutation 0315 is excluded because 315 has fewer digits than 3105. These exclusions make this sequence a subsequence of A090055. A084687 is a subsequence of this sequence.
Apparently each term of this sequence is divisible by 3. This has been confirmed for the first 100 terms.
From David A. Corneth, Jun 08 2025: (Start)
All terms are divisible by 3. Proof: Suppose a term t is not divisible by 3.
Then for some m < t that is an anagram of t with the same number of digits as t we have m * c = t where 2 <= c <= 9. If c > 9 then t has more digits than m and if c = 1 then m is a trivial anagram of t, excluded by definition.
Since m and t are anagrams, 9 | (t - m) = (c - 1)*m. If t is not divisible by 3 then m is not divisible by 3 and so 9 | c - 1. This is a contradiction since 2 <= c <= 9 for which no c is divisible by 9 which completes the proof.
In addition if t is not divisible by 9 then c = 4 or 7. (End)

Examples

			a(1)=3105 because 3105 is divisible by 1035, a nontrivial permutation of 3105 with the same number of digits.
a(4)=8316 because 8316 is divisible by 1386, a nontrivial permutation of 8316 with the same number of digits.
		

Crossrefs

Programs

  • Mathematica
    dnpQ[n_]:=Module[{d=FromDigits/@Select[Permutations[IntegerDigits[n]], First[#]>0&&Reverse[#]!=#&]},Count[Divisible[n,d],True]>1]; Select[ Range[90000],dnpQ] (* Harvey P. Dale, Aug 19 2013 *)
  • PARI
    \\ See Corneth link

Extensions

More terms from David A. Corneth, Jun 08 2025

A326307 a(n) is the index of n in the ordered list of the numbers with the same digits as n.

Original entry on oeis.org

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

Views

Author

David A. Corneth, Oct 17 2019

Keywords

Comments

Ordinal transform of A328447.

Examples

			a(321) = 6 as 321 is the sixth number made of the digits [1, 2, 3]. The five smaller numbers having these digits are 123, 132, 213, 231, 312.
		

Crossrefs

Programs

  • PARI
    see Corneth link
    
  • PARI
    { o = vector(100); for (n=0, 87, print1 (o[1+fromdigits(vecsort(digits(n,base=10),,4),base)]++ ", ")) } \\ Rémy Sigrist, Oct 17 2019
    
  • PARI
    A326307(n,D=Vecsmall(digits(n)),c=1)={forperm(vecsort(D),d, d==D&&break; d[1]&&c++);c} \\ M. F. Hasler, May 19 2021
    
  • Python
    from collections import Counter
    from itertools import count, islice
    def agen(): # generator of terms
        digmultisetcount = Counter()
        for n in count(0):
            key = "".join(sorted(str(n)))
            digmultisetcount[key] += 1
            yield digmultisetcount[key]
    print(list(islice(agen(), 88))) # Michael S. Branicky, Jan 30 2025

Formula

a(A179239(n)) = 1.
a(10+n) = A007953(9*n)/9 (A007953 = sum of digits) for 0 < n < 91, but a(101) = 1 while A007953(9*91)/9 = 2. - M. F. Hasler, May 19 2021

Extensions

Edited by N. J. A. Sloane, Oct 24 2019

A179308 List of positive integers, omitting any number n if another number with the same set of digits as n has already been listed.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 34, 35, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49, 50, 56, 57, 58, 59, 60, 67, 68, 69, 70, 78, 79, 80, 89, 90, 102, 103, 104, 105, 106, 107, 108, 109, 123, 124, 125
Offset: 1

Views

Author

Jack W Grahl, Jul 10 2010

Keywords

Comments

Numbers 1 to 10 are all new sets of digits. 11 is omitted because its digit set {1} is the same as that of 1. The following numbers are included, until 21 which has the same digit set as 12, and 22 which has the same set as 2.
This sequence is of course finite and has 1022 terms; the number of possible digit sets excluding the empty set and {0}.

Crossrefs

A subsequence of A179239.

Programs

  • Maple
    s:={}: for n from 1 to 1000 do d:=convert(convert(n,base,10),set): if(not member(d,s))then printf("%d, ",n): s:=s union {d}: fi: od: # Nathaniel Johnston, Jun 21 2011

Extensions

Corrected by Jack W Grahl, Jan 10 2011

A307560 a(n) = smallest m such that A307629(m) = n.

Original entry on oeis.org

0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 29, 39, 49, 59, 69, 79, 89, 99, 10000000000000000000, 109, 1006, 119, 100000000000000000000000, 129, 100004, 139, 1008, 149, 100000000000000000000000000000, 159, 10000000000000000000000000000000, 169, 1019, 179, 100006
Offset: 0

Views

Author

Arran Ireland, Apr 14 2019

Keywords

Examples

			a(39) = 1039 as (1 + 0) + (1 + 3) + (1 + 9) + (0 + 3) + (0 + 9) + (3 + 9) = 39. The sums in brackets are pairs of digits of 1039. No positive integer less than 1039 has this pairwise digit sum. - _David A. Corneth_, Apr 16 2019
		

Crossrefs

Programs

  • Magma
    for n in [1..50] do for d in Divisors(n) do if n le 9*d*(d+1) then nd:=d+1; sdLeft:=n div d; S:=[]; for j in [1..nd-1] do if sdLeft gt 9 then S[j]:=9; else S[j]:=sdLeft-1; end if; sdLeft-:=S[j]; end for; S[nd]:=sdLeft; a:=Seqint(S); n, a; break; end if; end for; end for; // Jon E. Schoenfield, Apr 15 2019
  • Mathematica
    fs[nd_, s_] := If[nd*9 < s, 0, Block[{n=10^(nd-1), f=0}, While[n < 10^nd, If[Total@ IntegerDigits@ n == s, f = n; Break[], n++]]; f]]; a[n_] := Block[{s}, Do[s = fs[d+1, n/d]; If[s > 0, Break[]], {d, Divisors[n]}]; s];  Join[{0}, Array[a,50]] (* Giovanni Resta, Apr 15 2019 *)

Formula

Let d be the smallest divisor of n for which 9*d*(d+1) >= n; then a(n) is the smallest (d+1)-digit number whose digit sum is n/d. - Jon E. Schoenfield, Apr 15 2019

A319274 Osiris or Digit re-assembly numbers: numbers that are equal to the sum of permutations of subsamples of their own digits.

Original entry on oeis.org

132, 264, 396, 8991, 10545, 35964, 255530, 1559844, 9299907, 47755078, 89599104, 167264994, 283797162, 473995260, 3929996070, 6379993620, 10009998999, 11111111110, 22222222220, 33333333330, 44444444440, 55555555550, 66666666660, 77777777770, 88888888880, 99999999990
Offset: 1

Views

Author

Pieter Post, Sep 16 2018

Keywords

Comments

This sequence differs from A241754 because this sequence uses permutations only once.
Permutations are of the same length k, leading zeros are allowed.
The k's in the sequence are: 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 7, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 7, 7, 8, 7, 9, 9.

Examples

			10545 = 014 + 015 + 041 + 045 + 051 + 054 + 055 + 104 + 105 + 140 + 145 + 150 + 154 + 155 + 401 + 405 + 410 + 415 + 450 + 451 + 455 + 501 + 504 + 505 + 510 + 514 + 515 + 540 + 541 + 545 + 550 + 551 + 554.
		

Crossrefs

Programs

  • Python
    import itertools
    def getData(a, b):
        dig = (itertools.permutations(str(a), b))
        for d in dig:
            yield d
    for w in range(2, 6):
        kk=int(w*'1')
        for i in range (kk, 10**(w+3), kk):
            m=[]
            get = getData(i, w)
            while True:
                try:
                    n = next(get)
                    ee=int("".join((n)))
                    if ee not in m:
                        m.append(ee)
                except StopIteration:
                    if sum (m)==i and len(m)>1:
                        m.sort()
                        print (sum(m), len(m), m, i)
                    break

Extensions

a(12)-a(26) from Giovanni Resta, Sep 16 2018

A369184 a(n) is the first positive number that has exactly n anagrams which have 3 prime divisors, counted by multiplicity, or 0 if there is no such number.

Original entry on oeis.org

1, 8, 103, 117, 156, 268, 1038, 1027, 1059, 1246, 1245, 1347, 1578, 3789, 10136, 10126, 10234, 10355, 10157, 10236, 10158, 11456, 10247, 10245, 10289, 10237, 10235, 10347, 10256, 10257, 10246, 10789, 10239, 10579, 12567, 10578, 13457, 12369, 14559, 12458, 12579, 23789, 24789, 12459, 100258, 12345
Offset: 0

Views

Author

Robert Israel, Jan 15 2024

Keywords

Comments

An anagram of a number k is a permutation of the base-10 digits of k with no leading 0's.
a(n) is the first k such that A175854(k) = n, or 0 if n is not a term of A175854.
Conjecture: all a(n) > 0.

Examples

			a(5) = 268 because 268 has 5 anagrams that have 3 prime divisors, counted by multiplicity, and is the first number that does that:
268 = 2^2 * 67, 286 = 2 * 11 * 13, 628 = 2^2 * 157, 682 = 2 * 11 * 31, 826 = 2 * 7 * 59.
		

Crossrefs

Cf. A014612, A175854. All terms are in A179239.

Programs

  • Maple
    f:= proc(n) local L, d, w, x, i;
          L:= convert(n, base, 10); d:= nops(L);
          L:= select(t -> t[-1] <> 0, combinat:-permute(L));
          L:= map(t-> add(t[i]*10^(i-1), i=1..d), L);
          nops(select(t -> numtheory:-bigomega(t)=3, L))
    end proc:
    g:= proc(xin,d,n) # first anagrams with n digits starting xin, all other digits >= d
      option remember;
      local i;
      if 1 + ilog10(xin) = n then return xin fi;
      seq(procname(10*xin+i,i,n), i=d..9)
    end proc:
    h:= proc(n) # first anagrams with n digits
      local i,j;
      seq(seq(g(i*10^j,i,n),j=n-1..0,-1),i=1..9)
    end proc:
    N:= 100: # for a(0) .. a(N)
    V:= Array(0..N): count:= 0:
    for i from 1 while count < N+1 do
      for x in [h(i)] while count < N+1 do
        v:= f(x);
        if v <= N and V[v] = 0 then V[v]:= x; count:= count+1; fi
      od
    od:
    convert(V,list);
  • Python
    from sympy import primeomega
    from sympy.utilities.iterables import multiset_permutations
    from itertools import combinations_with_replacement, count, islice
    def func(n): return sum(1 for p in multiset_permutations(str(n)) if p[0]!='0' and primeomega(int("".join(p)))==3)
    def agen(): # generator of terms
        adict, n = dict(), 0
        for d in count(1):
            for f in "123456789":
                for r in combinations_with_replacement("0123456789", d-1):
                    k = int(f+"".join(r))
                    v = func(k)
                    if v not in adict:
                        adict[v] = k
                        while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 44))) # Michael S. Branicky, Jan 15 2024

A046893 a(n) is the least number with exactly n permutations of digits that are primes.

Original entry on oeis.org

1, 2, 13, 103, 107, 1007, 1036, 1019, 1013, 1049, 1079, 1237, 10099, 10013, 10135, 10123, 10039, 10127, 10079, 10238, 10234, 10235, 10139, 10478, 12349, 12347, 10378, 12359, 14579, 10789, 100336, 10237, 12389, 23579, 10279, 100136, 12379, 10379, 100267, 13789
Offset: 0

Views

Author

Keywords

Comments

From Robert Israel, Feb 07 2023: (Start)
Permutations that have leading zeros are included, in contrast to A046890 where they are not.
If neither A046890(n) nor a(n) have the digit 0, then they are equal. (End)

Crossrefs

Cf. A039999, A046890. All terms are in A179239.

Programs

  • Maple
    g:= proc(d) local x,d1,y;
     [seq(seq(seq(x*10^d + y, y = [0,h(x,d1)]),d1=0..d-1),x=1..9)]
    end proc:
    g(0):= [$0..9]:
    h:= proc(x0, d) local y,z; option remember;
          seq(seq(y*10^d+z, z = [procname(y,d-1)]),y=x0..9)
    end proc:
    for x0 from 1 to 9 do h(x0,0):= $x0 .. 9 od:
    f:= proc(n) local t,L,d,P,i;
    t:= 0;
    L:= convert(n,base,10); d:= nops(L);
    for P in combinat:-permute(L) do
      if isprime(add(P[i]*10^(i-1),i=1..d)) then t:= t+1 fi
    od;
    t
    end proc:
    N:= 100: # for a(0)..a(N)
    V:= Array(0..N): count:= 0:
    for d from 0 while count < N+1 do
      for i in g(d) while count < N+1 do
      v:= f(i);
      if v <= N then
        if V[v] = 0 then V[v]:= i; count:= count+1; fi;
      fi
    od od:
    convert(V,list); # Robert Israel, Feb 07 2023
  • Mathematica
    a = Table[0, {40}]; Do[b = Count[ PrimeQ[ FromDigits /@ Permutations[ IntegerDigits[n]]], True]; If[b < 40 && a[[b + 1]] == 0, a[[b + 1]] = n; Print[b, " ", n]], {n, 1, 110000}]
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations as mp
    from itertools import count, islice, combinations_with_replacement as mc
    def nd(d): yield from ("".join((f,)+m) for f in "123456789" for m in mc("0123456789", d-1))
    def c(s): return sum(1 for p in mp(s) if p[0]!="0" and isprime(int("".join(p))))
    def agen(): # generator of sequence terms
        n, adict = 0, dict()
        for digs in count(1):
            for s in nd(digs):
                v = c(s)
                if v not in adict: adict[v] = int(s)
                while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 40))) # Michael S. Branicky, Feb 08 2023

A121977 Numbers with a distinct frequency for each decimal digit.

Original entry on oeis.org

100000000011111112222222333333444445555666778, 100000000011111112222222333333444445555666779, 100000000011111112222222333333444445555666787, 100000000011111112222222333333444445555666788, 100000000011111112222222333333444445555666797, 100000000011111112222222333333444445555666799, 100000000011111112222222333333444445555666877, 100000000011111112222222333333444445555666878
Offset: 1

Views

Author

Keywords

Examples

			100000000011111112222222333333444445555666778 has 9 0's, 8 1's, 7 2's, 6 3's, 5 4's, 4 5's, 3 6's, 2 7's, 1 8 and 0 9's. 121 is not in the sequence because there are eight digits it has zero of.
		

Crossrefs

Subsequence of A179239.
Previous Showing 11-20 of 35 results. Next