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.

Showing 1-10 of 41 results. Next

A011539 "9ish numbers": decimal representation contains at least one nine.

Original entry on oeis.org

9, 19, 29, 39, 49, 59, 69, 79, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 109, 119, 129, 139, 149, 159, 169, 179, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 209, 219, 229, 239, 249, 259, 269, 279, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298
Offset: 1

Views

Author

Keywords

Comments

The 9ish numbers are closed under lunar multiplication. The lunar primes (A087097) are a subset.
Almost all numbers are 9ish, in the sense that the asymptotic density of this set is 1: Among the 9*10^(n-1) n-digit numbers, only a fraction of 0.8*0.9^(n-1) doesn't have a digit 9, and this fraction tends to zero (< 1/10^k for n > 22k-3). This explains the formula a(n) ~ n. - M. F. Hasler, Nov 19 2018
A 9ish number is a number whose largest decimal digit is 9. - Stefano Spezia, Nov 16 2023

Examples

			E.g. 9, 19, 69, 90, 96, 99 and 1234567890 are all 9ish.
		

Crossrefs

Cf. A088924 (number of n-digit terms).
Cf. A087062 (lunar product), A087097 (lunar primes).
A102683 (number of digits 9 in n); fixed points > 8 of A068505.
Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), A337250 (b=4), A337572 (b=5), A333656 (b=6), A337141 (b=7), A337239 (b=8), A338090 (b=9), this sequence (b=10), A095778 (b=11).
Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).
Supersequence of A043525.

Programs

  • GAP
    Filtered([1..300],n->9 in ListOfDigits(n)); # Muniru A Asiru, Feb 25 2019
    
  • Haskell
    a011539 n = a011539_list !! (n-1)
    a011539_list = filter ((> 0) . a102683) [1..]  -- Reinhard Zumkeller, Dec 29 2011
    
  • Maple
    seq(`if`(numboccur(9, convert(n, base, 10))>0, n, NULL), n=0..100); # François Marques, Oct 12 2020
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 10 ], 9 ]>0)& ] (* François Marques, Oct 12 2020 *)
    Select[Range[300],DigitCount[#,10,9]>0&] (* Harvey P. Dale, Mar 04 2023 *)
  • PARI
    is(n)=n=vecsort(digits(n));n[#n]==9 \\ Charles R Greathouse IV, May 15 2013
    
  • PARI
    select( is_A011539(n)=vecmax(digits(n))==9, [1..300]) \\ M. F. Hasler, Nov 16 2018
    
  • Python
    def ok(n): return '9' in str(n)
    print(list(filter(ok, range(299)))) # Michael S. Branicky, Sep 19 2021
    
  • Python
    def A011539(n):
        def f(x):
            l = (s:=str(x)).find('9')
            if l >= 0: s = s[:l]+'8'*(len(s)-l)
            return n+int(s,9)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 04 2024

Formula

Complement of A007095. A102683(a(n)) > 0 (defines this sequence). A068505(a(n)) = a(n): fixed points of A068505 are the terms of this sequence and the numbers < 9. - Reinhard Zumkeller, Dec 29 2011, edited by M. F. Hasler, Nov 16 2018
a(n) ~ n. - Charles R Greathouse IV, May 15 2013

A087062 Array T(n,k) = lunar product n*k (n >= 1, k >= 1) read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 4, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 10, 2, 3, 4, 5, 5, 4, 3, 2, 10, 11, 10, 3, 4, 5, 6, 5, 4, 3, 10, 11, 11, 11, 10, 4, 5, 6, 6, 5, 4, 10, 11, 11, 11, 12, 11, 10, 5, 6, 7, 6, 5, 10, 11, 12, 11, 11, 12, 12
Offset: 1

Views

Author

Marc LeBrun, Oct 09 2003

Keywords

Comments

See A087061 for definition. Note that 0+x = x and 9*x = x for all x.
This differs from A003983 at a(46): min(1,10)=1, while lunar product 10*1 = 10.
We have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing. - N. J. A. Sloane, Aug 06 2014

Examples

			Lunar multiplication table begins:
1 1 1 1 1 ...
1 2 2 2 2 ...
1 2 3 3 3 ...
1 2 3 4 4 ...
1 2 3 4 5 ...
		

Crossrefs

Cf. A087061 (addition), A003983 (min), A087097 (lunar primes).
See A261684 for a version that includes the zero row and column.

Programs

  • Maple
    # convert decimal to string: rec := proc(n) local t0,t1,e,l; if n <= 0 then RETURN([[0],1]); fi; t0 := n mod 10; t1 := (n-t0)/10; e := [t0]; l := 1; while t1 <> 0 do t0 := t1 mod 10; t1 := (t1-t0)/10; l := l+1; e := [op(e),t0]; od; RETURN([e,l]); end;
    # convert string to decimal: cer := proc(ep) local i,e,l,t1; e := ep[1]; l := ep[2]; t1 := 0; if l <= 0 then RETURN(t1); fi; for i from 1 to l do t1 := t1+10^(i-1)*e[i]; od; RETURN(t1); end;
    # lunar addition: dadd := proc(m,n) local i,r1,r2,e1,e2,l1,l2,l,l3,t0; r1 := rec(m); r2 := rec(n); e1 := r1[1]; e2 := r2[1]; l1 := r1[2]; l2 := r2[2]; l := max(l1,l2); l3 := min(l1,l2); t0 := array(1..l); for i from 1 to l3 do t0[i] := max(e1[i],e2[i]); od; if l>l3 then for i from l3+1 to l do if l1>l2 then t0[i] := e1[i]; else t0[i] := e2[i]; fi; od; fi; cer([t0,l]); end;
    # lunar multiplication: dmul := proc(m,n) local k,i,j,r1,r2,e1,e2,l1,l2,l,t0; r1 := rec(m); r2 := rec(n); e1 := r1[1]; e2 := r2[1]; l1 := r1[2]; l2 := r2[2]; l := l1+l2-1; t0 := array(1..l); for i from 1 to l do t0[i] := 0; od; for i from 1 to l2 do for j from 1 to l1 do k := min(e2[i],e1[j]); t0[i+j-1] := max(t0[i+j-1],k); od; od; cer([t0,l]); end;
  • Mathematica
    ladd[x_, y_] := FromDigits[MapThread[Max, IntegerDigits[#, 10, Max@IntegerLength[{x, y}]] & /@ {x, y}]];
    lmult[x_, y_] := Fold[ladd, 0, Table[10^i, {i, IntegerLength[y] - 1, 0, -1}]*FromDigits /@ Transpose@Partition[Min[##] & @@@ Tuples[IntegerDigits[{x, y}]], IntegerLength[y]]];
    Flatten[Table[lmult[k, n - k + 1], {n, 1, 13}, {k, 1, n}]] (* Davin Park, Oct 06 2016 *)
  • PARI
    lmul=A087062(m,n,d(n)=Vecrev(digits(n)))={sum(i=1,#(n=d(n))-1+#m=d(m), vecmax(vector(min(i,#n),j,if(#m>i-j,min(n[j],m[i-j+1]))))*10^i)\10} \\ M. F. Hasler, Nov 13 2017
  • Python
    def lunar_add(n,m):
        sn, sm = str(n), str(m)
        l = max(len(sn),len(sm))
        return int(''.join(max(i,j) for i,j in zip(sn.rjust(l,'0'),sm.rjust(l,'0'))))
    def lunar_mul(n,m):
        sn, sm, y = str(n), str(m), 0
        for i in range(len(sm)):
            c = sm[-i-1]
            y = lunar_add(y,int(''.join(min(j,c) for j in sn))*10**i)
        return y # Chai Wah Wu, Sep 06 2015
    

Extensions

Maple programs from N. J. A. Sloane.
Incorrect comment and Mathematica program removed by David Applegate, Jan 03 2012
Edited by M. F. Hasler, Nov 13 2017

A087097 Lunar primes (formerly called dismal primes) (cf. A087062).

Original entry on oeis.org

19, 29, 39, 49, 59, 69, 79, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 109, 209, 219, 309, 319, 329, 409, 419, 429, 439, 509, 519, 529, 539, 549, 609, 619, 629, 639, 649, 659, 709, 719, 729, 739, 749, 759, 769, 809, 819, 829, 839, 849, 859, 869, 879, 901, 902, 903, 904, 905, 906, 907, 908, 909, 912, 913, 914, 915, 916, 917, 918, 919, 923, 924, 925, 926, 927, 928, 929, 934, 935, 936, 937, 938, 939, 945, 946, 947, 948, 949, 956, 957, 958, 959, 967, 968, 969, 978, 979, 989
Offset: 1

Views

Author

Marc LeBrun, Oct 20 2003

Keywords

Comments

9 is the multiplicative unit. A number is a lunar prime if it is not a lunar product (see A087062 for definition) r*s where neither r nor s is 9.
All lunar primes must contain a 9, so this is a subsequence of A011539.
Also, numbers k such that the lunar sum of the lunar prime divisors of k is k. - N. J. A. Sloane, Aug 23 2010
We have changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing. - N. J. A. Sloane, Aug 06 2014
(Lunar) composite numbers are not necessarily a product of primes. (For example 1 = 1*x for any x in {1, ..., 9} is not a prime but can't be written as the product of primes.) Therefore, to establish primality, it is not sufficient to consider only products of primes; one has to consider possible products of composite numbers as well. - M. F. Hasler, Nov 16 2018

Examples

			8 is not prime since 8 = 8*8. 9 is not prime since it is the multiplicative unit. 10 is not prime since 10 = 10*8. Thus 19 is the smallest prime.
		

Crossrefs

Programs

  • PARI
    A87097=select( is_A087097(n)={my(d); if( n<100, n>88||(n%10==9&&n>9), vecmax(d=digits(n))<9, 0, #d<5, vecmin(d)A087062(m,k)==n&&return))))}, [1..999]) \\ M. F. Hasler, Nov 16 2018

Formula

The set { m in A011539 | 9A054054(m) < min(A000030(m),A010879(m)) } (9ish numbers A011539 with 2 digits or such that the smallest digit is strictly smaller than the first and the last digit) is equal to this sequence up to a(1656) = 10099. The next larger 9ish number 10109 is also in that set but is the lunar square of 109, thus not in this sequence of primes. - M. F. Hasler, Nov 16 2018

A087019 Lunar squares: n*n where * is lunar multiplication (A087062).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 111, 112, 113, 114, 115, 116, 117, 118, 119, 200, 211, 222, 223, 224, 225, 226, 227, 228, 229, 300, 311, 322, 333, 334, 335, 336, 337, 338, 339, 400, 411, 422, 433, 444, 445, 446, 447, 448, 449, 500, 511, 522, 533, 544, 555, 556, 557, 558
Offset: 0

Views

Author

Marc LeBrun and N. J. A. Sloane, Oct 19 2003

Keywords

Comments

Sequence is not monotonic (1011*1011 = 1011111 > 1020*1020 = 1010200). In fact it even contains repetitions (11011*11011 = 11111*11111 = 111111111). See A172199. - N. J. A. Sloane, Dec 20 2010

Crossrefs

Cf. A087062 (lunar product), A087097 (lunar primes).

Programs

Formula

a(n)=A087062(n,n). - M. F. Hasler, Nov 15 2018

A087029 Number of lunar divisors of n (unbounded version).

Original entry on oeis.org

9, 8, 7, 6, 5, 4, 3, 2, 1, 18, 90, 16, 14, 12, 10, 8, 6, 4, 2, 16, 16, 72, 14, 12, 10, 8, 6, 4, 2, 14, 14, 14, 56, 12, 10, 8, 6, 4, 2, 12, 12, 12, 12, 42, 10, 8, 6, 4, 2, 10, 10, 10, 10, 10, 30, 8, 6, 4, 2, 8, 8, 8, 8, 8, 8, 20, 6, 4, 2, 6, 6, 6, 6, 6, 6, 6, 12, 4, 2, 4, 4, 4, 4
Offset: 1

Views

Author

Marc LeBrun and N. J. A. Sloane, Oct 19 2003

Keywords

Comments

Number of d, 1 <= d < infinity, such that there exists an e, 1 <= e < infinity, with d*e = n, where * is lunar multiplication.

Examples

			The 18 divisors of 10 are 1, 2, ..., 9, 10, 20, 30, ..., 90, so a(10) = 18.
		

Crossrefs

Cf. A087062 (lunar product).
Cf. A087028, A087083, A186443, A186510. See A189506 for the actual divisors.
See A067399 for the base-2 version.

Programs

  • Maple
    (Uses programs from A087062. This crude program is valid for n <= 99.) dd2 := proc(n) local t1,t2,i,j; t1 := []; for i from 1 to 99 do for j from i to 99 do if dmul(i,j) = n then t1 := [op(t1),i,j]; fi; od; od; t1 := convert(t1,set); t2 := sort(convert(t1,list)); nops(t2); end;
  • PARI
    A087029(n)=#A189506_row(n) \\ To be optimized. - M. F. Hasler, Nov 15 2018

Extensions

More terms from David Applegate, Nov 07 2003
Minor edits by M. F. Hasler, Nov 15 2018

A087636 Number of n-digit lunar primes.

Original entry on oeis.org

0, 18, 81, 1539, 20457, 242217, 2894799, 33535839, 381591711
Offset: 1

Views

Author

Marc LeBrun and N. J. A. Sloane, Oct 26 2003

Keywords

Comments

Although a(1) through a(6) are divisible by 9, a(7) is not.

Crossrefs

Cf. A087062 (lunar product), A087097 (lunar primes), A087638 (partial sums).

Programs

  • PARI
    A87636=[]; A087636(n)={while(#A87636A087097(k)); A87636[n]} \\ Store results in array A87636 to avoid re-calculation. - M. F. Hasler, Nov 15 2018

Extensions

a(6)-a(9) from David Applegate, Nov 07 2003

A088924 Number of "9ish numbers" with n digits.

Original entry on oeis.org

1, 18, 252, 3168, 37512, 427608, 4748472, 51736248, 555626232, 5900636088, 62105724792, 648951523128, 6740563708152, 69665073373368, 716985660360312, 7352870943242808, 75175838489185272, 766582546402667448
Offset: 1

Views

Author

Marc LeBrun, Oct 23 2003

Keywords

Comments

First difference of A016189. ("9" can be replaced by any other nonzero digit, however only the 9ish numbers are closed under lunar multiplication.)
See A257285 - A257289 for first differences of 5^n-4^n, ..., 9^n-8^n. These also give the number of n-digit numbers whose largest digit is 5, 6, 7, 8, respectively. - M. F. Hasler, May 04 2015

Examples

			a(2) = 18 because 19, 29, 39, 49, 59, 69, 79, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 and 99 are the eighteen two-digit 9ish numbers.
		

Crossrefs

Programs

Formula

a(n) = 9*10^(n-1) - 8*9^(n-1).
G.f.: x*(1 - x)/(1 - 19*x + 90*x^2). - Bobby Milazzo, May 02 2014
a(n) = 19*a(n-1) - 90*a(n-2). - Vincenzo Librandi, May 04 2015
E.g.f.: (81*exp(10*x) - 80*exp(9*x) - 1)/90. - Stefano Spezia, Nov 16 2023

A089898 Product of (digits of n each incremented by 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 8, 16, 24, 32, 40, 48, 56, 64
Offset: 0

Views

Author

Marc LeBrun, Nov 13 2003

Keywords

Comments

Sum of products of all subsets of digits of n (with the empty subset contributing 1).
Number of nonnegative values k such that the lunar sum of k and n is n.
First 100 values are 10 X 10 multiplication table, read by rows/columns.

Examples

			a(12)=6 since (1+1)*(2+1)=2*3=6 and since (1*2)+(1)+(2)+(1)=2+1+2+1=6 and since the lunar sum of 12 with any of the six values {0,1,2,10,11,12} is 12.
		

Crossrefs

Programs

  • Haskell
    a089898 n = if n < 10 then n + 1 else (d + 1) * a089898 n'
                where (n', d) = divMod n 10
    -- Reinhard Zumkeller, Jul 06 2014
  • Maple
    seq(convert(map(`+`,convert(n,base,10),1),`*`), n = 0 .. 1000); # Robert Israel, Nov 17 2014
  • Mathematica
    a089898[n_Integer] :=
    Prepend[Array[Times @@ (IntegerDigits[#] + 1) &, n], 1]; a089898[77] (* Michael De Vlieger, Dec 22 2014 *)
  • PARI
    a(n) = my(d=digits(n)); prod(i=1, #d, d[i]+1); \\ Michel Marcus, Apr 06 2014
    
  • PARI
    a(n) = vecprod(apply(x->x+1, digits(n))); \\ Michel Marcus, Feb 01 2023
    

Formula

a(n) = a(floor(n/10))*(1+(n mod 10)). - Robert Israel, Nov 17 2014
G.f. g(x) satisfies g(x) = (10*x^11 - 11*x^10 + 1)*g(x^10)/(x-1)^2. - Robert Israel, Nov 17 2014

A087052 Lunar triangular numbers: 0+1+2+3+...+n, where + is lunar addition.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199
Offset: 0

Views

Author

Marc LeBrun and N. J. A. Sloane, Oct 19 2003

Keywords

Comments

Differs from A087121 after 100 terms.
If duplicates are removed we get A051885. - N. J. A. Sloane, Jan 25 2011

Crossrefs

Cf. A051885.

Programs

  • Maple
    (Continuing from A087062) dt := proc(n) local i,t1; t1 := 0; for i from 1 to n do t1 := dadd(t1,i); od: t1; end;

A087028 Number of bounded (<=n) lunar divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 9, 9, 9, 8, 7, 6, 5, 4, 3, 2, 8, 8, 8, 8, 7, 6, 5, 4, 3, 2, 7, 7, 7, 7, 7, 6, 5, 4, 3, 2, 6, 6, 6, 6, 6, 6, 5, 4, 3, 2, 5, 5, 5, 5, 5, 5, 5, 4, 3, 2, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 19, 10, 9, 8, 7, 6, 5, 4, 3, 2, 100, 91, 17, 15, 13, 11, 9, 7, 5, 3, 25, 25, 81, 22, 19, 16, 13, 10, 7, 4, 22, 22, 22, 64, 19, 16, 13, 10, 7, 4, 19, 19, 19, 19, 49, 16, 13, 10, 7, 4, 16, 16, 16, 16, 16, 36, 13, 10, 7, 4, 13, 13, 13, 13, 13, 13, 25, 10, 7, 4, 10, 10, 10, 10, 10, 10, 10, 16, 7, 4, 7, 7, 7, 7, 7, 7, 7, 7, 9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 17
Offset: 1

Views

Author

Marc LeBrun and N. J. A. Sloane, Oct 19 2003

Keywords

Comments

Number of d, 1 <= d <= n, such that there exists an e, 1 <= e <= n, with d*e = n, where * is lunar multiplication.

Examples

			The 10 divisors of 10 <= 10 are 1, 2, ..., 9, 10.
a(100) = 19, since the lunar divisors of 100 <= 100 are 1, 2, ..., 9, 10, 20, ..., 90, 100.
		

Crossrefs

Programs

  • Maple
    (Uses programs from A087062) dd1 := proc(n) local t1,t2,i,j; t1 := []; for i from 1 to n do for j from i to n do if dmul(i,j) = n then t1 := [op(t1),i,j]; fi; od; od; t1 := convert(t1,set); t2 := sort(convert(t1,list)); nops(t2); end;
Showing 1-10 of 41 results. Next