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 21-30 of 69 results. Next

A076166 Primes p such that sum of cubes of even digits of p equals sum of cubes of odd digits of p.

Original entry on oeis.org

16447, 41467, 41647, 44617, 46147, 46471, 76441, 114451, 144511, 146407, 404167, 404671, 414607, 415141, 416407, 440761, 441607, 451411, 460147, 460417, 461407, 470461, 476041, 476401, 541141, 610447, 640741, 644107, 644701, 647401, 704461, 740461, 746041, 764041
Offset: 1

Views

Author

Zak Seidov, Nov 01 2002

Keywords

Comments

Minimal number of digits in p is 5. n such that sum of even digits equals sum of odd digits in A036301.
To find terms of this sequence, one could look at zerofree positive integers having the criterion on sum of cubes of digits. Then permute the digits to see which are prime. Using those digits with 0 and permuting then only needs the check on primality. - David A. Corneth, Dec 11 2018

Examples

			16447 is OK because 1^3 + 7^3 = 6^3 + 4^3 + 4^3.
14467 has digits in nondecreasing order (is zerofree). Of the 60 permutations, 16447, 41467, 41647, 44617, 46147, 46471, 76441 are prime. - _David A. Corneth_, Dec 11 2018
		

Crossrefs

Subsequence of A076165.

Programs

  • Mathematica
    oeQ[n_]:=Module[{idn = IntegerDigits[n]}, Total[Select[idn, OddQ]^3] == Total[ Select[idn, EvenQ]^3]]; Select[Range[100000], PrimeQ[#] && oeQ[#] &] (* Amiram Eldar, Dec 10 2018 after Harvey P. Dale at A076165 *)
  • PARI
    isok(p) = isprime(p) && (d=digits(p)) && (sum(i=1, #d, d[i]^3*if(d[i]%2, 1, -1))==0); \\ Michel Marcus, Dec 13 2018

A165370 Smallest number whose sum of cubes of digits is n.

Original entry on oeis.org

0, 1, 11, 111, 1111, 11111, 111111, 1111111, 2, 12, 112, 1112, 11112, 111112, 1111112, 11111112, 22, 122, 1122, 11122, 111122, 1111122, 11111122, 111111122, 222, 1222, 11222, 3, 13, 113, 1113, 11113, 2222, 12222, 112222, 23, 123, 1123, 11123
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 17 2009

Keywords

Comments

A055012(a(n)) = n and A055012(m) <> n for m < a(n).
For all terms the digits are in nondecreasing order.
From Ondrej Kutal, Oct 06 2024: (Start)
a(n) can be formulated as a solution to an integer linear programming problem: Let c_i be the number of occurrences of digit i in the number (1 <= i <= 9). We want to minimize c_1 + c_2 + ... + c_9 (total number of digits) subject to the constraints c_1 + 8*c_2 + 27*c_3 + ... + 729*c_9 = n and c_i >= 0 for all i. To get the smallest solution among all with this number of digits, we further maximize the number of 1s (c_1), then the number of 2s (c_2), and so on up to 9s (c_9). This approach ensures we find the lexicographically smallest number with the minimum number of digits whose sum of cubes equals n.
a(n) can be computed by selecting a digit d (1 <= d <= 9) that minimizes the result of concatenating d with a(n-d^3), where n-d^3 >= 0. This can be done efficiently using dynamic programming.
As it turns out, the sequence is periodic (up to the trailing 9s) for n >= 4609, with a period of 729. Therefore, only a finite amount of values need to be computed; the rest can be derived by appending the appropriate number of 9s.
(End)

Crossrefs

Programs

  • PARI
    a(n) = my(k=1); while(vecsum(apply(x->(x^3), digits(k))) != n, k++); k; \\ Michel Marcus, Sep 08 2019
    
  • Python
    # using dynamic programming
    def A165370(n):
        # caching numbers,their tenth power (for fast concatenation) and cube sum
        cache = [(None, None, None)] * (n + 1)
        cache[0] = (0, 1, 0)
        cubes = [i**3 for i in range(10)]
        for i in range(1, min(n + 1, 5832)):
            for d in range(1, 10):
                if i - cubes[d] >= 0:
                    sub_result, tenthpower, cubesum = cache[i - cubes[d]]
                    if sub_result is not None:
                        current = d * tenthpower + sub_result
                        if cache[i][0] is None or current < cache[i][0]:
                            cache[i] = (current, 10 * tenthpower, cubesum + cubes[d])
        if n < 5832:
            return cache[n][0]
        sub_result, _, cubesum = cache[5103 + n % 729]
        nines = (n - cubesum) // 729
        return (sub_result + 1) * (10 ** nines) - 1 # Ondrej Kutal, Oct 06 2024

A274124 Numbers n such that (product of digits of n) is divisible by (sum of digits of n) and digits of n are in nondecreasing order.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 36, 44, 66, 88, 123, 138, 145, 159, 167, 189, 224, 235, 246, 257, 268, 279, 333, 345, 347, 357, 369, 448, 456, 459, 466, 578, 579, 666, 678, 789, 999, 1124, 1146, 1168, 1225, 1233, 1236, 1247, 1258, 1269, 1344, 1348, 1356, 1368, 1447
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Every number with a digit 0 is in A038367. Every permutation of every element of this is in A038367. These elements describe A038367 completely.
Intersection of A038367 and A009994.

Crossrefs

Programs

  • PARI
    is(n) = my(v=vecsort(digits(n))); v==digits(n) && prod(i=1,#v,v[i]) % vecsum(v)==0

A327750 Numbers without zero digits such that after adding the product of its digits to it, a number with the same product of digits is obtained.

Original entry on oeis.org

28, 128, 214, 239, 266, 318, 326, 364, 494, 497, 563, 598, 613, 637, 695, 819, 1128, 1214, 1239, 1266, 1318, 1326, 1364, 1494, 1497, 1563, 1598, 1613, 1637, 1695, 1819, 2114, 2139, 2168, 2285, 2313, 2356, 2369, 2419, 2594, 2639, 2791, 3118, 3126, 3148, 3213, 3235
Offset: 1

Views

Author

Bernard Schott, Sep 24 2019

Keywords

Comments

The idea of this sequence comes from a problem in the annual Moscow Mathematical Olympiad (MMO) in 2003: Level A, problem 2. The problem only asks to find a ten-digit number that has the property of the name.
When an integer k belongs to this sequence, the integer 111..11//k obtained by concatenation // of 111..11 and k is also a term; hence, there are primitive terms as 28, 214, 239, 266, 318, 326, ... (A340908).
A subset of it is formed by the numbers 239, 326, 364, 497, 563, 598, 613, 637, 695, 819, 1239, 1326, 1364, 1497, 1563, 1598, 1613, 1637, 1695, 1819, 2139, 2313, 2356, 2369, ... for which the number obtained after adding the product of the digits has exactly the same digits (they are obtained by permuting the digits of the initial number). So, 239 + 2*3*9 = 239 + 54 = 293, 326 + 3*2*6 = 326 + 36 = 362, 3235 + 3*2*3*5 = 3235 + 90 = 3325, 23286 + 2*3*2*8*6 = 23286 + 576 = 23862. - Marius A. Burtea, Sep 24 2019
This subset is A247888. - Bernard Schott, Jul 22 2020

Examples

			28 + 2*8 = 44 and 2*8 = 4*4 hence 28 is a term.
326 + 3*2*6 = 362 and 3*2*6 = 3*6*2 hence 326 is another term.
		

Crossrefs

Subsequences: A247888, A340907, A340908 (primitives).

Programs

  • Magma
    [k:k in [1..3500]| not 0 in Intseq(k) and &*Intseq(k) eq &*(Intseq(k+&*Intseq(k)))]; // Marius A. Burtea, Sep 24 2019
    
  • Mathematica
    pd[n_] := Times @@ IntegerDigits[n]; aQ[n_] := (p = pd[n]) > 0 && pd[n + p] == p; Select[Range[5000], aQ] (* Amiram Eldar, Sep 24 2019 *)
  • PARI
    isok(n) = my(d = digits(n), p); vecmin(d) && (p=vecprod(d)) && (vecprod(digits(n+p)) == p); \\ Michel Marcus, Sep 24 2019
    
  • Python
    def test(n):
        m, p = n, 1
        while m > 0:
            m, p = m//10, p*(m%10)
        if p == 0:
            return 0
        m, q = n+p, 1
        while m > 0:
            m, q = m//10, q*(m%10)
        return p == q
    n, a = 0, 0
    while n < 100:
        a = a+1
        if test(a):
            n = n+1
        print(n,a) # A.H.M. Smeets, Sep 25 2019

Extensions

More terms from Amiram Eldar, Sep 24 2019

A342264 Lexicographically earliest sequence of distinct nonnegative terms such that both a(n) and a(n) + a(n+1) have digits in nondecreasing order.

Original entry on oeis.org

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

Views

Author

Eric Angelini and Carole Dubois, Mar 07 2021

Keywords

Comments

10 is obviously the first integer not present in the sequence as 1 > 0.

Examples

			a(10) = 9 and a(11) = 13 sum up to 22: the three numbers have digits in nondecreasing order;
a(11) = 13 and a(12) = 11 sum up to 24 (same property);
a(12) = 11 and a(13) = 12 sum up to 23 (same property);
etc.
		

Crossrefs

Cf. A009994 (numbers with digits in nondecreasing order), A342265 and A342266 (variations on the same idea).

Programs

  • Maple
    ND[1]:= [$1..9]:
    for d from 2 to 5 do
       ND[d]:= map(proc(t) local j; seq(10*t + j,j=(t mod 10) .. 9) end proc, ND[d-1])
    od:
    S:= [seq(op(ND[i]),i=1..5)]): nS:= nops(S):
    isnd:= proc(x) member(x,ND[ilog10(x)+1]) end proc:
    R:= 0: t:= 0:
    for count from 2 to 100 do
      found:= false;
      for i from 1 to nS do
        if isnd(t + S[i]) then
          R:= R, S[i];
          t:= S[i];
          S:= subsop(i=NULL, S);
          nS:= nS-1;
          found:= true;
          break
        fi;
      od;
      if not found then break fi;
    od:
    R; # Robert Israel, Jul 14 2025
  • Python
    def nondec(n): s = str(n); return s == "".join(sorted(s))
    def aupton(terms):
      alst = [0]
      for n in range(2, terms+1):
        an = 1
        while True:
          while an in alst: an += 1
          if nondec(an) and nondec(alst[-1]+an): alst.append(an); break
          else: an += 1
      return alst
    print(aupton(74)) # Michael S. Branicky, Mar 07 2021

A342265 Lexicographically earliest sequence of distinct nonnegative terms such that both a(n) and the cumulative sum a(1)+a(2)+...+a(n) have digits in nondecreasing order.

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 7, 6, 8, 9, 11, 12, 44, 13, 14, 16, 22, 45, 15, 18, 23, 55, 24, 88, 33, 77, 34, 78, 111, 333, 17, 19, 79, 29, 89, 25, 99, 199, 112, 444, 26, 28, 56, 35, 188, 113, 119, 556, 114, 999, 122, 1199, 888, 123, 4444, 36, 66, 124, 118, 222, 445, 115, 129, 67, 133, 667, 134, 68, 889, 223
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Mar 07 2021

Keywords

Comments

10 is obviously the first integer not present in the sequence as 1 > 0.
The last term is a(173) = 122222, at which point the cumulative sum is 12467999, and the sequence cannot be extended. - Michael S. Branicky, Feb 05 2024

Examples

			Terms a(1) = 0 to a(5) = 5 sum up to 11: those six numbers have digits in nondecreasing order;
terms a(1) = 0 to a(6) = 4 sum up to 15: those seven numbers have digits in nondecreasing order;
terms a(1) = 0 to a(7) = 7 sum up to 22: those eight numbers have digits in nondecreasing order; etc.
		

Crossrefs

Cf. A009994 (numbers with digits in nondecreasing order), A342264 and A342266 (variations on the same idea).

Programs

  • Python
    def nondec(n): s = str(n); return s == "".join(sorted(s))
    def aupton(terms):
      alst = [0]
      for n in range(2, terms+1):
        an, cumsum = 1, sum(alst)
        while True:
          while an in alst: an += 1
          if nondec(an) and nondec(cumsum + an): alst.append(an); break
          else: an += 1
      return alst
    print(aupton(100)) # Michael S. Branicky, Mar 07 2021

A342266 Lexicographically earliest sequence of distinct nonnegative terms such that both a(n) and a(n) * a(n+1) have digits in nondecreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 7, 5, 9, 13, 12, 14, 16, 18, 26, 44, 27, 17, 15, 23, 29, 46, 28, 48, 47, 24, 19, 117, 38, 36, 33, 34, 37, 67, 35, 127, 114, 39, 57, 78, 146, 236, 58, 77, 1444, 177, 157, 2477, 144, 247, 45, 25, 49, 227, 147, 257, 1777, 12568, 116, 68, 66, 118, 113, 59, 226, 148, 166, 134, 167, 334
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Mar 07 2021

Keywords

Comments

10 is obviously the first integer not present in the sequence as 1 > 0; 11 will never show either because the result of a(n) * 11 is already in the sequence or because the said result has digits in contradiction with the definition.
It would be good to have a proof that there is an infinite sequence with the desired property. It could happen then any choice for any number of initial terms will eventually fail. - David A. Corneth and N. J. A. Sloane, Mar 07 2021
The authors agree, but are unable to give the desired proof. So it is indeed possible that this sequence is wrong from the first term on.

Examples

			a(5) = 4 and a(6) = 6 have product 24: the three numbers have digits in nondecreasing order;
a(6) = 6 and a(7) = 8 have product 48: the three numbers have digits in nondecreasing order;
a(7) = 8 and a(7) = 7 have product 56: the three numbers have digits in nondecreasing order; etc.
		

Crossrefs

Cf. A009994 (numbers with digits in nondecreasing order), A342264 and A342265 (variations on the same idea).

A045910 Numbers with digits nondecreasing and their reciprocals sum to 1/(positive integer).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 36, 44, 66, 88, 236, 244, 333, 488, 666, 999, 2488, 2666, 3366, 3446, 4444, 6999, 8888, 26999, 28888, 33999, 34688, 36666, 44488, 44666, 55555, 366999, 368888, 446999, 448888, 466688, 666666, 3999999, 4688999, 4888888, 6666999, 6668888, 7777777, 66999999, 68888999, 88888888, 999999999
Offset: 1

Views

Author

Keywords

Comments

Intersection of A037264 and A009994, A214949(a(n)) = 1. - Reinhard Zumkeller, Aug 02 2012

Examples

			1/3 + 1/4 + 1/6 + 1/8 + 1/8 = 1/1, so 34688 is in the sequence.
		

Crossrefs

Condensation (by ordering digits) and completion of A037264.

Programs

  • Haskell
    a045910 n = a045910_list !! (n-1)
    a045910_list =  [x | x <- takeWhile (<= 999999999) $ a009994_list,
                         a214949 x == 1]
    -- Reinhard Zumkeller, Aug 02 2012

A046811 Numbers (with nonzero digits only) where A046810 increases.

Original entry on oeis.org

1, 2, 13, 113, 149, 1123, 1237, 11234, 11239, 12347, 12359, 12367, 12379, 13459, 13789, 111389, 112279, 112337, 112346, 112348, 112349, 112379, 112679, 113789, 123457, 123467, 123469, 123479, 1112347, 1112357, 1112359, 1113479, 1122349
Offset: 1

Views

Author

Keywords

Examples

			A046810(*) reaches 3 for the first time at 113.
		

Crossrefs

Programs

  • Maple
    S[1]:= [seq([i],i=1..9)]:
    for d from 2 to 7 do S[d]:= map(t -> seq([i,op(t)],i=t[1]..9),S[d-1]) od:
    f:= proc(L) local t,i;
      add(`if`(isprime(add(t[i]*10^(i-1),i=1..nops(t))),1,0),t=combinat:-permute(L))
    end proc:
    R:= NULL: m:= -1:
    for d from 1 to 7 do
    for L in S[d] do
        v:= f(L);
        if v > m then m:= v;  x:= add(L[i]*10^(i-1),i=1..nops(L)); R:= R,x; fi
    od od:
    R; # Robert Israel, Mar 31 2025

Extensions

Offset corrected by Robert Israel, Mar 31 2025

A055481 Numbers k for which there exists some m such that k = Sum_{i=1..1+floor(log_10(k))} binomial(m, d_i), where d_i is the i-th digit of k.

Original entry on oeis.org

1, 10, 18, 21, 72, 100, 101, 111, 134, 231, 246, 505, 682, 1000, 1010, 1100, 1122, 2210, 3103, 4006, 6008, 10000, 10001, 10012, 11101, 15453, 20101, 29358, 34698, 56576, 84304, 100000, 100010, 100011, 100100, 100101, 100110, 100303, 101000, 101001, 101010
Offset: 1

Views

Author

Erich Friedman, Jun 27 2000

Keywords

Comments

Contains numbers of the form 10^k, k >= 0 so the sequence is infinite. - David A. Corneth, Oct 30 2018

Examples

			3103 = C(22, 3) + C(22, 1) + C(22, 0) + C(22, 3).
C(k, 1) + C(k, 1) + C(k, 1) + C(k, 0) + C(k, 0) + C(k, 0) = 3k + 3 so all 6-digit numbers with 3 ones and 3 zeros are in the sequence. - _David A. Corneth_, Oct 30 2018
		

Crossrefs

Programs

  • Mathematica
    ok[n_] := Block[{d = IntegerDigits@n, k=1, v, x}, If[ Max@d <= 3, False =!= Reduce[ Total@ Binomial[x, d] == n && x>0, x, Integers], While[(v = Total@ Binomial[k, d]) < n, k++]; v == n]]; Select[ Range[10^5], ok] (* Giovanni Resta, Oct 30 2018 *)
  • PARI
    is(n) = my(d = digits(n)); for(i = 1, n, s = sum(j = 1, #d, binomial(i, d[j])); if(s >= n, return(s == n))) \\ David A. Corneth, Oct 30 2018

Extensions

a(31)-a(41) from Giovanni Resta, Oct 30 2018
Previous Showing 21-30 of 69 results. Next