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 30 results.

A261020 Numbers k such that the set of the decimal digits is a subgroup of the multiplicative group (Z/mZ)* where m is the sum of the decimal digits of k.

Original entry on oeis.org

11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91, 111, 124, 139, 142, 193, 214, 241, 319, 391, 412, 421, 913, 931, 1111, 1115, 1133, 1151, 1155, 1177, 1199, 1248, 1284, 1313, 1331, 1379, 1397, 1428, 1482, 1511, 1515, 1551, 1717, 1739, 1771, 1793
Offset: 1

Views

Author

Michel Lagneau, Aug 07 2015

Keywords

Comments

(Z/mZ)* is the multiplicative group of units of Z/mZ.
Let d(1)d(2)...d(q) be the q decimal digits of a number k. The principle of the algorithm is to compute all the products d(i)*d(j) (mod m) for 1 <= i,j <= q, and also the multiplicative inverse of each element such that if x is in the group, then there exists x' in the group where x*x' = 1.
The sequence is infinite because the numbers 11, 111, 1111, ... are in the sequence and generate the trivial subgroup {1}.
Only zerofree elements of A009996 have to be checked. Terms that match the criterion and permutations of their digits form all terms of this sequence due to commutativity of multiplication. - David A. Corneth, Aug 08 2015
To reduce cases, only check terms from A009995 (containing a 1 but no 0) for values m from digsum(term) to 81. - David A. Corneth, Aug 13 2015
Each decimal digit must be relatively prime to the decimal digit sum. - Tom Edgar, Aug 17 2015

Examples

			139 is a term because 1+3+9 = 13 and the elements {1, 3, 9} form a subgroup of the multiplicative group (Z/13Z)* with 12 elements. Each element is invertible: 1*1 == 1 (mod 13), 3*9 == 1 (mod 13) and 9*3 == 1 (mod 13). The other numbers of the sequence having the same property with (Z/13Z)* are 139, 193, 319, 391, 913, and 931.
1248 is in the sequence because 1+2+4+8 = 15 and the elements {1, 2, 4, 8} form a subgroup of the multiplicative group (Z/15Z)* with 8 elements: {1,2,4,7,8,11,13,14}.
		

Crossrefs

Programs

  • Maple
    nn:=2000:
    for n from 1 to nn do:
    x:=convert(n,base,10):nn0:=length(n):
    lst1:={op(x),x[nn0]}:n0:=nops(lst1):
    s:=sum('x[i]', 'i'=1..nn0):lst:={}:
       if  lst1[1]=1 then
        for j from 1 to n0 do:
         for l from j to n0 do:
          p:=irem(lst1[j]*lst1[l],s):lst:=lst union {p}:
         od:
        od:
        if lst=lst1
         then
           n3:=nops(lst1):lst2:={}:
            for c from 1 to n3 do:
              for d from 1 to n3 do:
               if irem(lst1[c]*lst1[d], s)=1
                then
                lst2:=lst2 union {lst1[c]}:
                else
               fi:
              od:
             od:
               if lst2=lst
               then
               printf(`%d, `, n):
               else
               fi:
              fi:
             fi:
         od:
  • Sage
    def is_group(n):
        DD=n.digits()
        digsum=sum(DD)
        D=Set(DD)
        if not(1 in D) or 0 in D:
            return false
        for x in D:
            for y in D:
                if not(gcd(y,digsum)==1):
                    return false
                if not((x*inverse_mod(y,digsum))%digsum in D):
                    return false
        return true
    [n for n in [1..2000] if is_group(n)] # Tom Edgar, Aug 17 2015

A261021 a(1)=0; for n > 1, a(n) is the number k such that the set of the decimal digits is an additive group Z/mZ where m is the sum of the decimal digits.

Original entry on oeis.org

0, 101, 102, 110, 120, 201, 202, 204, 210, 220, 240, 303, 306, 330, 360, 402, 404, 408, 420, 440, 480, 505, 550, 603, 606, 630, 660, 707, 770, 804, 808, 840, 880, 909, 990, 1001, 1002, 1010, 1020, 1100, 1200, 2001, 2002, 2004, 2010, 2020, 2040, 2100, 2200, 2400
Offset: 1

Views

Author

Michel Lagneau, Aug 07 2015

Keywords

Comments

By convention, a(1)=0 because the trivial additive group is usually denoted by 0 where 0 is the identity element.
Let d(1)d(2)..d(q) be the q decimal digits of a number k. The principle of the algorithm is to compute all the sums (d(i)+ d(j))/mZ for 1 <= i,j <= q, and also the additive inverse of each element such that if x is in the group, then there exists x' in the group where x+x' = 0.
The sequence is infinite because the numbers 101, 1001, 10001, ... are in the sequence and generate the group {0,1}.
Only terms of A009996 containing at least one 0 have to be checked. Terms that match the criterion and numbers containing at least one 0 formed by permutations of their digits form all terms of this sequence due to commutativity of addition. - David A. Corneth, Aug 13 2015

Examples

			408 is in the sequence because 4+0+8 = 12 and the elements {0, 4, 8} is an additive group, subgroup of (Z/12Z,+) with 6 elements {0, 2, 4, 6, 8, 10}. Each element has an inverse: 2+10 == 0 (mod 12), 4+8 == 0 (mod 12), 6+6 == 0 (mod 12), 8+4 == 0 (mod 12) and 10+2 == 0 (mod 12).
The subsequence having the same property with Z/12Z is {408, 480, 606, 660, 804, 840, 4008, 4080, 4800, 6006, 6060, 6600, 8004, 8040, 8400, 40008, 40080, 40800, 48000, 60006, 60060, 60600, 66000, 80004, 80040, 80400, 84000, ...}.
		

Crossrefs

Programs

  • Maple
    nn:=3000:
    for n from 1 to nn do:
    x:=convert(n,base,10):nn0:=length(n):
    lst1:={op(x),x[nn0]}:n0:=nops(lst1):
    s:=sum('x[i]', 'i'=1..nn0):lst:={}:
       if  lst1[1]=0 then
        for j from 1 to n0 do:
         for l from j to n0 do:
          p:=irem(lst1[j]+lst1[l],s):lst:=lst union {p}:
         od:
        od:
        if lst=lst1
         then
           n3:=nops(lst1):lst2:={}:
            for c from 1 to n3 do:
              for d from 1 to n3 do:
               if irem(lst1[c]+lst1[d], s)=0
                then
                lst2:=lst2 union {lst1[c]}:
                else
               fi:
              od:
             od:
               if lst2=lst
               then
               printf(`%d, `, n):
               else
               fi:
              fi:
             fi:
         od:
  • PARI
    is(n) = {my(d = digits(n),s = Set(digits(n))); if(n==0,return(1));
    if(#s==2 || #s==3,return(s[1]==0 && (s[#s] / s[2] == 2^(#s-2)) && hammingweight(d)==2),return(0))}
    \\a(n) works for n > 1.
    a(n) = {my(qd = ((-1 + sqrt(1 + 8*(n + 15+1/2) / 17)) / 2)\1 + 2, v = vector(qd),i=1,h=2); n -= (binomial(qd-1,2)*17 -16); while(n-(qd-1)*h>0,
    n-=(qd-1)*h;i++; h=1 + (i%2 == 0) + (i < 5)); n--; v[1]=i;
    v[qd-n\h] = i*2^(n%h-(i%2==0)); sum(i=1,#v,10^(#v-i)*v[i])} \\ David A. Corneth, Aug 13 2015

Formula

For d >= 3, there are (d - 1) * 17 terms having d digits. - David A. Corneth, Aug 13 2015

A273046 Fibonacci numbers with digits in nonincreasing order.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 21, 55, 610, 987
Offset: 1

Views

Author

Omar E. Pol, May 13 2016

Keywords

Comments

Presumably there are no more terms in this sequence. - Charles R Greathouse IV, May 17 2016

Crossrefs

Programs

  • Mathematica
    Select[Fibonacci@ Range[0, 10^4], Reverse@ Sort@ # == # &@ IntegerDigits@ # &] (* Michael De Vlieger, May 13 2016 *)
  • PARI
    fibmod(n,m)=lift(((Mod([1,1;1,0],m))^n)[1,2])
    isA009996(n)=my(d=digits(n)); vecsort(d,,4)==d
    B1=10^9;B2=10^57;
    for(n=1,1e9, if(isA009996(fibmod(n,B1)) && isA009996(fibmod(n,B2)) && isA009996(F=fibonacci(n)), print1(F", "))) \\ Charles R Greathouse IV, May 17 2016

A355063 Perfect powers whose digits are in nonincreasing order and do not include 0.

Original entry on oeis.org

1, 4, 8, 9, 32, 64, 81, 441, 841, 961, 7744, 7776, 8874441, 9853321, 999887641
Offset: 1

Views

Author

Jon E. Schoenfield, Jun 16 2022

Keywords

Comments

a(16) > 10^45 if it exists. - Michael S. Branicky, Jun 19 2022

Crossrefs

Programs

  • Mathematica
    perfectPowerQ[n_] := n==1||GCD @@ FactorInteger[n][[All, 2]] > 1; (* A001597 *) Select[Range[10^5], perfectPowerQ[#] && Max[Differences[d=IntegerDigits[#]]]<1 && Count[d,0]==0&] (* Stefano Spezia, Jul 01 2025 *)
  • PARI
    isok(m) = if (ispower(m), my(d=digits(m)); vecmin(d) && (d == vecsort(d,,4))); \\ Michel Marcus, Jun 17 2022
  • Python
    from sympy import perfect_power as pp
    from itertools import count, islice, combinations_with_replacement as mc
    def agen():
        yield 1
        for d in count(1):
            nd = (int("".join(m)) for m in mc("987654321", d))
            yield from sorted(filter(pp, nd))
    print(list(islice(agen(), 14))) # Michael S. Branicky, Jun 16 2022
    

A378808 Numbers with monotonically decreasing digits, decreasing by only 0 or 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 22, 32, 33, 43, 44, 54, 55, 65, 66, 76, 77, 87, 88, 98, 99, 100, 110, 111, 210, 211, 221, 222, 321, 322, 332, 333, 432, 433, 443, 444, 543, 544, 554, 555, 654, 655, 665, 666, 765, 766, 776, 777, 876, 877, 887, 888, 987, 988, 998, 999
Offset: 1

Views

Author

Randy L. Ekl, Dec 07 2024

Keywords

Examples

			32 is a term since it has monotonically decreasing digits whose difference is at most 1.
33 is a term since it also has monotonically decreasing digits whose difference is at most 1.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[999],SubsetQ[{0,1},-Differences[IntegerDigits[#]]] &] (* Stefano Spezia, Dec 08 2024 *)
  • Python
    from itertools import count, islice
    def bgen(last, d):
        if d == 0: yield tuple(); return
        t = (1, 9) if last == None else (max(0, last-1), last)
        for i in range(t[0], t[1]+1): yield from ((i,)+r for r in bgen(i, d-1))
    def agen(): # generator of terms
        yield from (int("".join(map(str, i))) for d in count(1) for i in bgen(None, d))
    print(list(islice(agen(), 62))) # Michael S. Branicky, Dec 08 2024

A265324 Numbers with nonincreasing digits such that every cyclic shift is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 71, 73, 97, 311, 733, 971, 991, 9311, 999331, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Chai Wah Wu, Dec 07 2015

Keywords

Comments

a(18) is too big to display, see the b-file.
a(n) is the intersection of the sequences A068652 and A009996.

Crossrefs

A344887 a(n) is the least base k >= 2 that the base-k digits of n are nonincreasing.

Original entry on oeis.org

2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 4, 5, 2, 3, 2, 2, 2, 5, 3, 6, 4, 3, 3, 5, 2, 3, 3, 3, 2, 7, 2, 2, 2, 6, 6, 6, 3, 4, 7, 3, 3, 4, 4, 6, 7, 7, 7, 7, 2, 7, 5, 8, 4, 4, 3, 5, 2, 4, 4, 8, 2, 4, 2, 2, 2, 9, 3, 3, 9, 9, 9, 10, 3, 8, 9, 3, 3, 9, 3, 3, 3, 3, 10, 10, 4, 4
Offset: 0

Views

Author

Rémy Sigrist, Jun 01 2021

Keywords

Examples

			For n = 258:
- we have:
     b  258 in base b  Nonincreasing?
     -  -------------  --------------
     2      100000010  No
     3         100120  No
     4          10002  No
     5           2013  No
     6           1110  Yes
- so a(258) = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[k=1;While[AnyTrue[Differences@IntegerDigits[n,++k],#>0&]];k,{n,0,100}] (* Giorgos Kalogeropoulos, Jun 02 2021 *)
  • PARI
    a(n) = { for (b=2, oo, my (d=digits(n, b)); if (d==vecsort(d,,4), return (b))) }
    
  • Python
    # with library / without (faster for large n)
    from sympy.ntheory import digits
    def is_nondec(n, b): d = digits(n, b)[1:]; return d == sorted(d)[::-1]
    def is_nondec(n, b):
      if n < b: return True
      n, r = divmod(n, b)
      while n >= b:
        (n, r), lastd = divmod(n, b), r
        if r < lastd: return False
      return n >= r
    def a(n):
      for b in range(2, n+3):
        if is_nondec(n, b): return b
    print([a(n) for n in range(86)]) # Michael S. Branicky, Jun 01 2021

Formula

a(n) <= A000196(n) + 2.
a(n) <= 10 for any n in A009996.
a(n) = 2 iff n belongs to A023758.

A364831 Primes whose digits are prime and in nonincreasing order.

Original entry on oeis.org

2, 3, 5, 7, 53, 73, 733, 773, 5333, 7333, 7753, 55333, 75533, 75553, 77773, 733333, 755333, 775553, 7553333, 7555333, 7775533, 7777753, 55555333, 55555553, 77755553, 555553333, 755555533, 773333333, 777555553, 777773333, 777775333, 777775553, 777777773
Offset: 1

Views

Author

James C. McMahon, Aug 09 2023

Keywords

Comments

Intersection of A028867 and A019546.
The subsequence for primes whose digits are prime and in strictly decreasing order has just six terms: 2 3 5 7 53 73 (see A177061).

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[3100000]], AllTrue[d = IntegerDigits[#], PrimeQ] && GreaterEqual @@ d &]
  • Python
    from itertools import count, islice, chain, combinations_with_replacement
    from sympy import isprime
    def A364831_gen(): # generator of terms
        yield 2
        yield from chain.from_iterable((sorted(s for d in combinations_with_replacement('753',l) if isprime(s:=int(''.join(d)))) for l in count(1)))
    A364831_list = list(islice(A364831_gen(),30)) # Chai Wah Wu, Sep 10 2023

A352721 Perfect cubes whose decimal digits appear in nonincreasing order.

Original entry on oeis.org

0, 1, 8, 64, 1000, 8000, 64000, 1000000, 8000000, 64000000, 1000000000, 8000000000, 64000000000, 1000000000000, 8000000000000, 64000000000000, 1000000000000000, 8000000000000000, 64000000000000000, 1000000000000000000, 8000000000000000000, 64000000000000000000
Offset: 1

Views

Author

Antonio Roldán, Mar 30 2022

Keywords

Examples

			64 is in the sequence because it is a perfect cube (64 = 4^3) whose digits appear in nonincreasing order.
		

Crossrefs

Intersection of A000578 and A009996.

Programs

  • Mathematica
    Select[Range[0, 4*10^6]^3, Max@ Differences[IntegerDigits[#]] <= 0 &] (* Amiram Eldar, Mar 30 2022 *)
  • PARI
    ok(n) = digits(n) == vecsort(digits(n),,4) && ispower(n,3)

Formula

a(n) = A004647(n-1)^3.

A357030 a(n) is the number of integers in 0..n having nonincreasing digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, 23, 24, 24, 24, 24, 24, 24, 25, 26, 27, 28, 29, 30, 30, 30, 30, 30, 31, 32, 33, 34, 35, 36, 37, 37, 37, 37, 38, 39, 40
Offset: 0

Views

Author

Osman Mustafa Quddusi, Sep 09 2022

Keywords

Examples

			a(20) = 13 because there are 13 numbers in 0..20 whose digits are in nonincreasing order: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20.
		

Crossrefs

Cf. A009996.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0, a(n-1)+`if`(
         (l-> is(l=sort(l)))(convert(n, base, 10)), 1, 0))
        end:
    seq(a(n), n=0..72);  # Alois P. Heinz, Sep 12 2022
  • Mathematica
    Accumulate @ Table[If[GreaterEqual @@ IntegerDigits[n], 1, 0], {n, 0, 72}] (* Amiram Eldar, Sep 10 2022 *)
  • PARI
    a(n) = sum(k=0, n, my(d=digits(k)); d == vecsort(d,,4)); \\ Michel Marcus, Sep 10 2022
Previous Showing 21-30 of 30 results.