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

A333955 Numbers k with digits in nondecreasing order and each digit greater than 1 such that the iterated product of digits of k is a prime.

Original entry on oeis.org

2, 3, 5, 7, 26, 34, 35, 37, 57, 223, 278, 279, 299, 355, 359, 367, 369, 389, 447, 469, 557, 579, 666, 999, 2247, 2269, 2337, 2339, 2349, 2366, 2699, 2799, 3335, 3336, 3338, 3346, 3357, 3399, 3499, 3669, 3679, 3889, 3999, 4689, 4788, 5579, 5777, 6668, 22227, 22239, 22336
Offset: 1

Views

Author

David A. Corneth, Apr 11 2020

Keywords

Comments

Primitive sequence of A028843. If k is in this sequence, then one can concatenate as many 1s as one likes, and/or permute the digits, to get terms of A028843 that are not in this sequence. For example, from 35 in this sequence, we can obtain 135, 1135, 11135, ... as well as 153, 315, 351, 1153, 1315, 1351, 1513, 1531, etc.

Examples

			For 35, we have 3 * 5 = 15 and then 1 * 5 = 5, which is a prime. Furthermore, the digits of 35 are nondecreasing and all digits of 35 are greater than 1, so 35 is in the sequence.
Likewise with 37, we see that 3 * 7 = 21 and 2 * 1 = 2, which is prime, and 3 < 7, so 37 is also in the sequence. The numbers 137, 1137, 11137, etc., are in A028843 but are not in this sequence of account of containing the digit 1.
With 43, we confirm that 4 * 3 = 12 and 1 * 2 = 2, which is prime, but 4 > 3, so 43 is not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[25000], Min[(d = IntegerDigits[#])] > 1 && (Length[d] < 2 || Min @ Differences[d] > -1) && PrimeQ[FixedPoint[IntegerDigits @ (Times @@ #)&, d][[1]]] &] (* Amiram Eldar, Apr 14 2020 *)
  • PARI
    is(n) = my(d=digits(n), v); if(d!=(v=vecsort(d))||v[1]<2, return(0)); while(n>=10, n=vecprod(digits(n))); isprime(n)
    
  • Scala
    def hasDigitsSorted(n: Int): Boolean = {
      val digSort = Integer.parseInt(n.toString.toCharArray.sorted.mkString)
      n == digSort
    }
    def iterDigitProd(n: Int): Int = n.toString.length match {
      case 1 => n
      case  => iterDigitProd(n.toString.toCharArray.map( - 48).scanRight(1)( * ).head)
    }
    val prelim = (1 to 20000).filter(hasDigitsSorted(_)).filter(n => List(2, 3, 5, 7).contains(iterDigitProd(n)))
    prelim.filter(!.toString.startsWith("1")) // _Alonso del Arte, Apr 20 2020

A341009 Numbers whose sum of even digits and sum of odd digits differ by 8.

Original entry on oeis.org

8, 17, 26, 35, 44, 53, 62, 71, 80, 107, 129, 170, 192, 206, 219, 224, 237, 242, 255, 260, 273, 291, 305, 327, 349, 350, 372, 394, 404, 422, 439, 440, 457, 475, 493, 503, 525, 530, 547, 552, 569, 574, 596, 602, 620, 659, 677, 695, 701, 710, 723, 732, 745, 754, 767, 776, 789
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 02 2021

Keywords

Crossrefs

Cf. A009994, A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).

Programs

  • Mathematica
    Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 8 &] (* Amiram Eldar, Feb 02 2021 *)
  • Python
    def eodiff(n):
      digs = list(map(int, str(n)))
      return abs(sum(d for d in digs if d%2==0)-sum(d for d in digs if d%2==1))
    def aupto(lim): return [m for m in range(lim+1) if eodiff(m) == 8]
    print(aupto(789)) # Michael S. Branicky, Feb 21 2021

A341011 a(n) is the smallest positive number m not yet in the sequence with the property that the sum of the even digits of m and the sum of the odd digits of m differ by n.

Original entry on oeis.org

112, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 119, 39, 139, 59, 159, 79, 179, 99, 199, 488, 399, 688, 599, 888, 799, 1799, 999, 1999, 11999, 3999, 13999, 5999, 15999, 7999, 17999, 9999, 19999, 68888, 39999, 88888, 59999, 159999, 79999, 179999, 99999, 199999, 1199999, 399999, 1399999, 599999, 1599999, 799999, 1799999, 999999
Offset: 0

Views

Author

Carole Dubois and Eric Angelini, Feb 02 2021

Keywords

Comments

This is the lexicographically earliest sequence of distinct integers > 0 having this property.
Indices of terms not congruent to 9 (mod 10): 0, 1, 2, 3, 4, 5, 6, 7, 8, 20, 22, 24, 38, 40, 56, .... - Robert G. Wilson v, Feb 21 2021

Examples

			a(19) = 199 since 199 is the smallest number such that the sum of even digits (0) and the sum of odd digits (19) differ by n = 19;
a(20) = 488 since 488 is the smallest number such that the sum of even digits (20) and the sum of odd digits (0) differ by n = 20; etc.
		

Crossrefs

Programs

  • Mathematica
    del[n_] := Abs[Plus @@ Select[(d = IntegerDigits[n]), OddQ] - Plus @@ Select[d, EvenQ]]; m = 54; s = Table[0, {m}]; c = n = 0; While[c < m, n++; i = del[n]; If[i > 0 && i <= m && s[[i]] == 0, c++; s[[i]] = n]]; s (* Amiram Eldar, Feb 02 2021 *)
    f[n_] := Block[{b, c, d, e, o}, d = 0; c = Floor[n/9]; b = 10^c -1; While[n != (Plus @@ IntegerDigits[d*10^c + b]), If[ OddQ@ d, d += 2, d++]]; o = d*10^c + b;
    d = 0; c = Floor[n/8]; b = 8(10^c -1)/9; While[n != (Plus @@ IntegerDigits[d*10^c + b]), If[ OddQ@ d, d++, d += 2]]; e = d*10^c + b; Min[o, e]]; f[0] = 112; (* Robert G. Wilson v, Feb 21 2021 *)

Extensions

a(0) added by Robert G. Wilson v, Feb 21 2021

A343403 Numbers k such that the product of the digits of k is not the product of digits of any earlier term in the sequence.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 25, 26, 27, 28, 29, 35, 37, 38, 39, 45, 47, 48, 49, 55, 56, 57, 58, 59, 67, 68, 69, 77, 78, 79, 88, 89, 99, 255, 256, 257, 258, 259, 267, 268, 269, 277, 278, 279, 288, 289, 299, 355, 357, 358, 359, 377, 378, 379, 388, 389, 399, 455
Offset: 1

Views

Author

Collin King, Apr 14 2021

Keywords

Comments

Observations:
The digits 0 and 1 appear only in terms 0 and 1, respectively.
Terms cannot contain two 2s, two 3s, a 2 and a 3, a 2 and a 4, a 3 and a 4, or a 4 and a 6.
Digits in each term appear in ascending order (A009994).

Crossrefs

Cf. A003001, A007954, A009994 (ascending digits), A031346, A068189, A343160.

Programs

  • Maple
    # product of digits
    A007954 := proc(n::integer)
        if n = 0 then
            0;
        else
            mul( d, d=convert(n, base, 10)) ;
        end if;
    end proc:
    hit:=Array(0..10000,-1);
    a:=[0];
    hit[0]:=0;
    for n from 1 to 50000 do p:=A007954(n);
       if p>0 and hit[p]=-1 then hit[p]:=n; a:=[op(a),n]; fi; od:
    a; # N. J. A. Sloane, Apr 14 2021
  • PARI
    See Links section.

A348318 Number of n-digit Niven (or Harshad) numbers not containing the digit 0.

Original entry on oeis.org

9, 14, 108, 710, 4978, 35724, 273032, 2097356, 16674554, 135091242, 1112325268, 9296413365, 77991481271, 654495034497, 5420117473932
Offset: 1

Views

Author

Bernard Schott, Oct 17 2021

Keywords

Comments

This sequence comes from a problem, proposed by Argentina during the 39th International Mathematical Olympiad in 1998 at Taipei, Taiwan, but not used for the competition. This problem asked for a proof that, for each positive integer n, there exists an n-digit number, not containing the digit 0 and that is divisible by the sum of its digits (see links: Diophante in French and Scholes in English).
This sequence gives the number of such n-digit Niven numbers not containing the digit 0.

Examples

			a(2) = 14 because there are 14 integers {12, 18, 21, 24, 27, 36, 42, 45, 48, 54, 63, 72, 81, 84} in the set of Niven numbers with 2 digits and not containing the digit 0.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := ! MemberQ[(d = IntegerDigits[n]), 0] && Divisible[n, Plus @@ d]; a[n_] := Module[{c = 0, k = (10^n - 1)/9}, While[k < 10^n, If[q[k], c++]; k++]; c]; Array[a, 6] (* Amiram Eldar, Oct 17 2021 *)
  • Python
    from itertools import product
    def a(n): return sum(1 for p in product("123456789", repeat=n) if int("".join(p))%sum(map(int, p)) == 0)
    print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Oct 17 2021

Extensions

a(6)-a(10) from Amiram Eldar, Oct 17 2021
a(11)-a(15) from Martin Ehrenstein, Oct 22 2021

A377948 Numbers that have at least 1 repeated decimal digit and whose decimal digits are nondecreasing as place value decreases.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 133, 144, 155, 166, 177, 188, 199, 222, 223, 224, 225, 226, 227, 228, 229, 233, 244, 255, 266, 277, 288, 299, 333, 334, 335, 336, 337, 338, 339, 344, 355, 366, 377, 388, 399
Offset: 1

Views

Author

Michael De Vlieger, Nov 14 2024

Keywords

Comments

Intersection of A009994 and A109303.
Does not intersect either A009993 or A009995.

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], And[CountDistinct[#] != Length[#], AllTrue[Differences[#], # >= 0 &]] &[IntegerDigits[#]] &]
    (* More efficient program: *)
    b = 10; mm = b - 1; nn = 14;
    s = Table[Map[Position[#, 1][[All, 1]] &,
      Permutations@ Join[ConstantArray[1, r], ConstantArray[0, mm - r] ] ],
        {r, Min[mm, nn]}];
    Union@ Flatten@ Table[
      w = Apply[Join, Permutations /@ IntegerPartitions[n, Min[mm, n - 1] ] ];
      Reap[Do[
        Sow[Table[FromDigits[Flatten@
          MapIndexed[ConstantArray[m[[First[#2] ]], #1] &,
          w[[i]]], b], {m, s[[Length[w[[i]]] ]]} ] ],
        {i, Length[w]}] ][[-1, 1]], {n, 2, nn}]

Formula

A178788(a(n)) = 0.

A110069 Numbers n such that n = (d_1 + d_2 + ... + d_k)*prime(d_1*d_2*...*d_k) where d_1 d_2 ... d_k is the decimal expansion of n.

Original entry on oeis.org

188217, 216925, 329319, 22146969, 236256594, 269226639788
Offset: 1

Views

Author

Farideh Firoozbakht, Jul 17 2005

Keywords

Comments

There is no further term up to 660000000.
This sequence is finite since (d_1+d_2+...+d_k)*prime(d_1*d_2*...*d_k) <= 9k * prime(9^k) << 9^k * k^2 << n. The bound can be made effective using the results of Dusart or others; for example, a(n) < 10^150. These can be improved with more work, but completing the sequence seems hard. - Charles R Greathouse IV, May 07 2011
a(7) > 7*10^14, if it exists. - Giovanni Resta, Jun 01 2020
If it exists, a(7) > 10^18. - Max Alekseyev, Jan 28 2024

Examples

			236256594 is in the sequence because 236256594 = (2 + 3 + 6 + 2 + 5 + 6 + 5 + 9 +4)*prime(2*3*6*2*5*6*5*9*4).
		

Crossrefs

Programs

  • Mathematica
    Do[h = IntegerDigits[m]; l = Length[h]; If[Min[h] > 0 && m == Sum[h[[k]], {k, l}]*(Prime[Product[h[[k]], {k, l}]]), Print[m]], {m, 655000000}]

Extensions

a(6) from Giovanni Resta, Jun 01 2020

A245017 Numbers k such that (product of digits of k) + 1 and (product of digits of k)^2 + 1 are both prime.

Original entry on oeis.org

1, 2, 4, 6, 11, 12, 14, 16, 21, 22, 23, 25, 28, 32, 41, 44, 49, 52, 58, 61, 66, 82, 85, 94, 111, 112, 114, 116, 121, 122, 123, 125, 128, 132, 141, 144, 149, 152, 158, 161, 166, 182, 185, 194, 211, 212, 213, 215, 218, 221, 224, 229, 231, 236, 242, 245, 251, 254, 263, 279, 281, 292
Offset: 1

Views

Author

Derek Orr, Jul 12 2014

Keywords

Comments

A number k is a term of this sequence iff A007954(k) and A007954(k)^2 are both in A006093.
This sequence is infinite. With any number a(n), you can add infinitely many 1's to its decimal representation. E.g., 82 is in this sequence, so 821, 812, 1182, 18112, 81211, etc. are also terms of this sequence.

Examples

			(9*4) + 1 = 37 is prime and (9*4)^2 + 1 = 1297 is prime. Thus 94 is a term of this sequence.
		

Crossrefs

Programs

  • Mathematica
    bpQ[n_]:=Module[{c=Times@@IntegerDigits[n]},AllTrue[{c+1,c^2+1},PrimeQ]]; Select[Range[300],bpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 09 2019 *)
  • PARI
    for(n=1, 10^3, d=digits(n); p=prod(i=1, #d, d[i]); if(ispseudoprime(p+1) && ispseudoprime(p^2 + 1), print1(n,", ")))

A256242 Numbers having digits in nondecreasing order and repeatedly setting n := A066308(n) yields a constant nonzero n.

Original entry on oeis.org

1, 89, 135, 139, 144, 233, 1224, 1367, 11249, 12222, 111126, 111266, 111338, 112229, 112337, 1111119, 1111134, 1111137, 1111177, 1111333, 1111346, 11111117, 11111119, 11111223, 11112236, 111111119, 111111139, 111111299, 111112334, 1111111169, 1111122233, 11111111118, 11111111133, 11111111369, 111111111133
Offset: 1

Views

Author

David A. Corneth, Mar 20 2015

Keywords

Comments

Intersection of A009994 and A256240. All digits differ from 0.
Permutations of all numbers of the elements in the table give the first 56622402 elements from A256240 (unsorted).

Crossrefs

Programs

  • PARI
    isok(n) = {d = digits(n); if (vecsort(d,,2) == d, ok = 1; while (ok, newn = sum(k=1, #d, d[k])*prod(k=1,#d, d[k]); if (! newn, return (0)); if (newn == n, return (1)); n = newn; d = digits(n);););} \\ Michel Marcus, Mar 27 2015

A302438 Numbers with digits in nondecreasing order and even digital sum (in base 10) whose digits can be partitioned in two multisets with equal digital sum.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 112, 123, 134, 145, 156, 167, 178, 189, 224, 235, 246, 257, 268, 279, 336, 347, 358, 369, 448, 459, 1111, 1113, 1122, 1124, 1133, 1135, 1144, 1146, 1155, 1157, 1166, 1168, 1177, 1179, 1188, 1199, 1223, 1225, 1234, 1236, 1245, 1247
Offset: 1

Views

Author

David A. Corneth, Apr 08 2018

Keywords

Examples

			a(5000) = 11222699 is in this sequence as it has digits in nondecreasing order and an even digital sum, which is 32. The digits can be partitioned in two multisets with equal sum, for example as {1, 6, 9} and {1, 2, 2, 2, 9}, each having sum 16.
		

Crossrefs

Programs

  • PARI
    \\ See PARI link.
Previous Showing 41-50 of 69 results. Next