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 51-60 of 69 results. Next

A304392 Numbers without a digit 1 with digits in nondecreasing order and the product of digits is a power of 6.

Original entry on oeis.org

6, 23, 49, 66, 229, 236, 334, 389, 469, 666, 2233, 2269, 2349, 2366, 2899, 3338, 3346, 3689, 4499, 4669, 6666, 22239, 22336, 22499, 22669, 23334, 23389, 23469, 23666, 26899, 33368, 33449, 33466, 34899, 36689, 44699, 46669, 66666, 88999, 222299, 222333, 222369, 223349
Offset: 1

Views

Author

David A. Corneth, Jun 20 2018

Keywords

Comments

Applying any of the following to terms in this sequence in any order gives a term from A276038: - Prepend a 1. - Permute digits. - Do nothing.
Subsequence of A276038.

Examples

			229 is in the sequence because it has digits in nondecreasing order, no digit 1 and a product of digits 2*2*9 = 36 which is a power of 6.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], And[FreeQ[#, 1], AllTrue[Differences@ #, # > -1 &], IntegerQ@ Log[6, Times @@ #]] &@ IntegerDigits@ # &] (* Michael De Vlieger, Jun 30 2018 *)
  • PARI
    is(n) = my(d = digits(n), p = prod(i = 1, #d, d[i])); d[1] >= 2 && vecsort(d) == d && 6^logint(p, 6) == p
    
  • Python
    from math import prod
    from sympy.utilities.iterables import multiset_combinations
    def auptod(maxdigs):
      n, digs, alst, targets = 0, 1, [], set(6**i for i in range(1, maxdigs*3))
      for digs in range(1, maxdigs+1):
        mcstr = "".join(str(d)*digs for d in "234689")
        for mc in multiset_combinations(mcstr, digs):
          if prod(map(int, mc)) in targets: alst.append(int("".join(mc)))
      return alst
    print(auptod(6)) # Michael S. Branicky, Jun 23 2021

A318275 Numbers with digits in nondecreasing order and with multiplicative digital root > 0.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 26, 27, 28, 29, 33, 34, 35, 36, 37, 38, 39, 44, 46, 47, 48, 49, 57, 66, 67, 68, 77, 79, 88, 89, 99, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 123, 124, 126, 127, 128, 129, 133, 134
Offset: 1

Views

Author

David A. Corneth, Aug 23 2018

Keywords

Comments

This sequence is a primitive sequence of A277061, it has digits in nondecreasing order. Terms in A277061 can be found by permuting digits of terms of this sequence.

Crossrefs

Programs

  • Mathematica
    Select[Range@ 134, And[FixedPoint[Times @@ IntegerDigits@ # &, #] != 0, AllTrue[Differences@ IntegerDigits@ #, # >= 0 &]] &] (* Michael De Vlieger, Aug 25 2018 *)

A340125 Numbers whose sum of even digits and sum of odd digits are equal and whose digits are in nondecreasing order.

Original entry on oeis.org

0, 112, 134, 156, 178, 336, 358, 1223, 1245, 1267, 1289, 1447, 1469, 2334, 2356, 2378, 2558, 3445, 3467, 3489, 3669, 4556, 4578, 5667, 5689, 6778, 7889, 11114, 11136, 11158, 11338, 12225, 12247, 12269, 12449, 22233, 22345, 22367, 22389, 22556, 22578, 23447, 23469, 24455
Offset: 1

Views

Author

David A. Corneth, Feb 21 2021

Keywords

Examples

			1223 is in the sequence as the sum of the odd digits is 1 + 3 = 4 and the sum of the even digits is 2 + 2 = 4 are equal.
		

Crossrefs

Intersection of A009994 and A036301.

Programs

  • Mathematica
    seodQ[n_]:=With[{idn=IntegerDigits[n]},Total[Select[idn,EvenQ]]==Total[Select[idn,OddQ]]&&Min[Differences[idn]]>=0]; Select[Range[0,25000],seodQ] (* Harvey P. Dale, Dec 30 2024 *)
  • PARI
    is(n) = { my(d = digits(n), w = vector(2)); if(d != vecsort(d), return(0)); for(i = 1, #d, w[d[i]%2 + 1] += d[i] ); w[1] == w[2] }
    
  • Python
    def ok(n):
      digs = list(map(int, str(n)))
      return sorted(digs) == digs and sum(d*(-1)**d for d in digs) == 0
    def aupto(lim): return [m for m in range(lim+1) if ok(m)]
    print(aupto(24455)) # Michael S. Branicky, Feb 21 2021

A342034 a(n) is the number of numbers k with n digits where k has digits in nondecreasing order and satisfies k < (product of digits of k) * (sum of digits of k).

Original entry on oeis.org

8, 41, 140, 367, 789, 1432, 2276, 3280, 4326, 5350, 6254, 7009, 7588, 7970, 8175, 8210, 8120, 7923, 7633, 7272, 6877, 6445, 6013, 5555, 5122, 4693, 4298, 3901, 3534, 3189, 2872, 2562, 2285, 2029, 1789, 1576, 1376, 1194, 1037, 893, 759, 654, 548, 454, 384, 315, 254, 210, 168, 127, 97, 79, 56, 39, 31, 21, 12, 8, 4
Offset: 1

Views

Author

David A. Corneth, Mar 05 2021

Keywords

Comments

As A066310 is finite there exists m such that a(n) = 0 for all n > m.
a(n) = 0 for n >= 85 since 9^n*9n <= 10^(n-1) for n >= 85. This may occur as early as n = 60, as 9^n*9n <= 10^n-1 for n >= 60. But a(59) > 0 since 10^59-1 < 9^59*9*59. - Michael S. Branicky, Mar 05 2021

Examples

			a(1) = 8 as there are 8 one-digit numbers k as described in name. Those are {2, 3, 4, 5, 6, 7, 8, 9}.
		

Crossrefs

Programs

  • PARI
    See PARI link
  • Python
    from math import prod
    from itertools import combinations_with_replacement as cwr
    def c(digs): return int("".join(map(str, digs))) < prod(digs) * sum(digs)
    def a(n): return sum(1 for u in cwr(range(1, 10), n) if c(u))
    print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Mar 05 2021
    

Extensions

a(27)-a(41) from Michael S. Branicky, Mar 05 2021

A342226 Numbers k with digits in nondecreasing order and satisfying k < (product of digits of k) * (sum of digits of k).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 33, 34, 35, 36, 37, 38, 39, 44, 45, 46, 47, 48, 49, 55, 56, 57, 58, 59, 66, 67, 68, 69, 77, 78, 79, 88, 89, 99, 127, 128, 129, 136, 137, 138, 139, 145, 146, 147, 148, 149, 155, 156, 157, 158
Offset: 1

Views

Author

David A. Corneth, Mar 06 2021

Keywords

Comments

This sequence contains 165623 terms.

Examples

			39 is in the sequence as 39 has digits in nondecreasing order and 39 < (3 + 9) * (3*9).
		

Crossrefs

Intersection of A009994 and A066310.

A342944 Numbers m such that d(1)^0 + d(2)^1 + ... + d(k)^(k-1) = d(1)! + d(2)! + ... + d(k)!, where d(i), i=1..k, are the digits of m.

Original entry on oeis.org

1, 11, 12, 111, 121, 133, 202, 1020, 1111, 1211, 1331, 1403, 2021, 2030, 2120, 2220, 2305, 2413, 3012, 3102, 3115, 3202, 3215, 3322, 3335, 4033, 4123, 4223, 4434, 10165, 10201, 10210, 10300, 10533, 11065, 11111, 11200, 12065, 12111, 12200, 13050, 13265, 13311
Offset: 1

Views

Author

Carole Dubois, Mar 30 2021

Keywords

Examples

			2413 is in this sequence because 2^0 + 4^1 + 1^2 + 3^3 = 2! + 4! + 1! + 3! = 33.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@20000,Total[(a=IntegerDigits@#)^Range[0,Length@a-1]]==Total[a!]&] (* Giorgos Kalogeropoulos, Mar 30 2021 *)
  • PARI
    is(n) = my(d = digits(n)); sum(i = 1, #d, d[i]!) == sum(i = 1, #d, d[i]^(i-1)) \\ David A. Corneth, Mar 30 2021
  • Python
    from math import factorial
    def digfac(s): return sum(factorial(int(d)) for d in s)
    def digpow(s): return sum(int(d)**i for i, d in enumerate(s))
    def aupto(limit):
      alst = []
      for k in range(1, limit+1):
        s = str(k)
        if digpow(s) == digfac(s): alst.append(k)
      return alst
    print(aupto(14000)) # Michael S. Branicky, Mar 30 2021
    

A344842 Numbers with digits in nondecreasing order whose digit sum is prime and whose digit product is a perfect square > 0.

Original entry on oeis.org

11, 14, 49, 111, 119, 122, 128, 133, 155, 166, 188, 199, 229, 236, 289, 368, 449, 559, 779, 1114, 1334, 1444, 1466, 1477, 1499, 2249, 2489, 3349, 4559, 4889, 4999, 11111, 11119, 11122, 11128, 11144, 11155, 11177, 11188, 11236, 11339, 11368, 11449, 11669, 11999, 12233
Offset: 1

Views

Author

David A. Corneth, May 29 2021

Keywords

Comments

Primitive sequence of A344825.

Examples

			49 is in the sequence as its product of digits is 36 which is a perfect square > 0 and its sum of digits is 13 which is prime.
		

Crossrefs

Programs

  • Mathematica
    ndoQ[n_]:=Module[{id=IntegerDigits[n]},FreeQ[id,0]&&Min[ Differences[id]]> = 0&&PrimeQ[Total[id]]&&IntegerQ[Sqrt[Times@@id]]]; Select[Range[ 12500],ndoQ] (* Harvey P. Dale, Jun 18 2021 *)
  • PARI
    uptoqdigits(n) = { my(res = List()); for(j = 2, n, forvec(x = vector(j, i, [1,9]), if(issquare(vecprod(x)) && isprime(vecsum(x)), listput(res, fromdigits(x)) ) , 1 ) ); res }
  • Python
    from math import prod
    from sympy import isprime, integer_nthroot
    from itertools import combinations_with_replacement as mc
    def ok(s):
      d = list(map(int, s))
      return '0' not in s and isprime(sum(d)) and integer_nthroot(prod(d), 2)[1]
    def auptod(digits): return [int("".join(p)) for d in range(2, digits+1) for p in mc("123456789", d) if ok("".join(p))]
    print(auptod(5)) # Michael S. Branicky, May 29 2021
    

Extensions

Definition (Name) corrected by Harvey P. Dale, Jun 18 2021

A350574 Primes p such that p, asc(p), and desc(p) are all distinct primes (where asc(p) and desc(p) are the digits of p in ascending and descending order, respectively) and p is the minimum of all permutations of its digits with this property.

Original entry on oeis.org

131, 197, 373, 419, 571, 593, 617, 839, 919, 1297, 1327, 1429, 1879, 1949, 1993, 2129, 2213, 2591, 3539, 4337, 4637, 4639, 5519, 6619, 8389, 8933, 11491, 11519, 11527, 11597, 11897, 11969, 12757, 12829, 12979, 13649, 13879, 14537, 14737, 14741, 14891
Offset: 1

Views

Author

William Riley Barker, Jan 06 2022

Keywords

Comments

All terms in this sequence are zero-free: If p contained 0 as a digit, then desc(p) would end with the zero digit, making it divisible by 10 (thus composite).

Examples

			131 is prime, and so are asc(131) = 113 and desc(131) = 311. Further, these are all distinct primes.
419, asc(419) = 149, and desc(419) = 941 are all distinct primes, and 419 is the smallest permutation of the digits {1,4,9} with this property (149 is not included because asc(149) = 149, so these would not be distinct; 491 is not included because 419 < 491 with the same set of digits).
		

Crossrefs

Cf. A009994.
Subsequence of A038618.

Programs

  • Maple
    d:= n-> convert(n, base, 10):
    g:= (n, r)-> parse(cat(sort(d(n), r)[])):
    f:= n-> (s-> nops(s)=3 and andmap(isprime, s))({n, g(n, `<`), g(n, `>`)}):
    q:= n-> f(n) and n=min(select(f, map(x-> parse(cat(x[])),
            combinat[permute](d(n))))):
    select(q, [$1..15000])[];  # Alois P. Heinz, Jan 15 2022
  • Mathematica
    Select[Prime@Range@2000,AllTrue[FromDigits/@{s=Sort[d=IntegerDigits@#],Reverse@s},PrimeQ]&&Min@Most@Rest@Sort@Select[FromDigits/@Permutations[d],PrimeQ]==#&] (* Giorgos Kalogeropoulos, Jan 16 2022 *)
  • Python
    import numpy as np
    # preliminary functions we will use in building our list
    def is_prime(n):
        for d in range(2,int(np.sqrt(n))+1):
            if n % d == 0:
                return False
        return True
    def asc(n): # returns integer with digits of n in ascending order
        n_list = [int(digit) for digit in str(n)] # separate digits of n into a list
        n_list.sort() # rearrange numbers in ascending order
        asc_n = int(''.join([str(digit) for digit in n_list])) # concatenate the sorted digits
        return asc_n
    def desc(n): # returns integer with digits of n in descending order
        n_list = [int(digit) for digit in str(n)]
        n_list.sort(reverse=True)
        desc_n = int(''.join([str(digit) for digit in n_list]))
        return desc_n
    N = 5
    # get list of integers n such that n, asc(n), and desc(n) are all distinct primes
    condition_1 = [n for n in range(2,10**N)
                   if is_prime(n)
                   and is_prime(asc(n))
                   and is_prime(desc(n))
                   and n not in (asc(n),desc(n))]
    # refine so that our list includes only the minimum permutation of a given set of digits satisfying condition 1
    condition_2 = []
    for num in condition_1:
        if asc(num) not in [asc(n) for n in condition_2]:
            condition_2.append(num)
    print(condition_2)
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A350574_gen(): # generator of terms
        for l in count(1):
            rlist = []
            for a in combinations_with_replacement('123456789',l):
                s = ''.join(a)
                p, q = int(s), int(s[::-1])
                if p != q and isprime(p) and isprime(q):
                    for b in multiset_permutations(a):
                        r = int(''.join(b))
                        if p < r < q and isprime(r):
                            rlist.append(r)
                            break
            yield from sorted(rlist)
    A350574_list = list(islice(A350574_gen(),50)) # Chai Wah Wu, Feb 13 2022

A354466 Numbers k such that the decimal expansion of the sum of the reciprocals of the digits of k starts with the digits of k in the same order.

Original entry on oeis.org

1, 13, 145, 153, 1825, 15789, 16666, 21583, 216666, 2416666, 28428571, 265833333, 3194444444, 3333333333, 9111111111, 35333333333, 3166666666666, 3819444444444, 26666666666666, 34166666666666, 527857142857142, 3944444444444444, 6135714285714285, 615833333333333333
Offset: 1

Views

Author

Metin Sariyar, Jun 01 2022

Keywords

Comments

The sequence is infinite because all numbers of the form 10^(10^n-6) + 6*(10^(10^n-6)-1)/9, (n>0) are terms.
All terms are zeroless since 1/0 is undefined.
If n gives a sum < 1 then that sum is taken as 0.xyz.. but n does not start with 0, so not a term.

Examples

			28428571 is a term because 1/2 + 1/8 + 1/4 + 1/2 + 1/8 + 1/5 + 1/7 + 1/1 = 2.8428571...
825 is not a term since 1/8 + 1/2 + 1/5 = 0.825.
		

Crossrefs

Programs

  • Mathematica
    Do[If[FreeQ[IntegerDigits[n], 0]&&Floor[Total[1/IntegerDigits[n]]*10^(IntegerLength[n]-IntegerLength[Floor[Total[1/IntegerDigits[n]]]])]==n&&Floor[Total[1/IntegerDigits[n]]]>0, Print[n]], {n, 1, 216666}]
  • PARI
    \\ See links.
  • Python
    # See links.
    

Extensions

a(12)-a(24) from Michael S. Branicky, Jun 03 2022

A360443 Smallest integer m > n such that the multiset of nonzero decimal digits of m is exactly the same as the multiset of nonzero decimal digits of n.

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 21, 31, 41, 51, 61, 71, 81, 91, 200, 102, 202, 32, 42, 52, 62, 72, 82, 92, 300, 103, 203, 303, 43, 53, 63, 73, 83, 93, 400, 104, 204, 304, 404, 54, 64, 74, 84, 94, 500, 105, 205, 305, 405, 505, 65, 75, 85, 95, 600
Offset: 1

Views

Author

Marc LeBrun and M. F. Hasler, Feb 22 2023

Keywords

Comments

Equivalently: a(n) is the number whose decimal digits are the next larger permutation of those of n, allowing any number of leading zeros.

Crossrefs

Cf. A057168 (analog for base 2), A354049 (digits of a(n) contain those of n as sub-multiset).
Cf. A009994 (numbers with digits in nondecreasing order: don't appear in this sequence).

Programs

  • PARI
    A360443(n)={forperm(concat(0,digits(n)),p,n||return(fromdigits(Vec(p))); n=0)} \\ M. F. Hasler, Feb 23 2023; similar idea also suggested by Ruud H.G. van Tol.
    
  • Python
    # From Arthur O'Dwyer, edited by M. F. Hasler, Feb 22 2023
    def A360443(n):
        s = '0' + str(n)
        i = next(i for i in range(len(s) - 1, 0, -1) if s[i-1] < s[i])
        tail = s[i-1:]
        j = min((ch, j) for j, ch in enumerate(tail) if s[i-1] < ch)[1]
        s = s[:i-1] + tail[j] + ''.join(sorted(tail[:j] + tail[j+1:]))
        return int(s)
    for n in range(1, 100): print(n, A360443(n))
Previous Showing 51-60 of 69 results. Next