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

A087984 9-ish numbers (A011539) which are not lunar primes (A087097).

Original entry on oeis.org

9, 119, 129, 139, 149, 159, 169, 179, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 229, 239, 249, 259, 269, 279, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 339, 349, 359, 369, 379, 389, 390, 391, 392, 393, 394, 395, 396
Offset: 1

Views

Author

David Applegate and N. J. A. Sloane, Oct 30 2003

Keywords

Comments

Three and four digit 9ish numbers are lunar primes iff the smallest digit is strictly smaller than the first and the last digit. This is no longer true from 10109 = 109 x 109 on (where x = lunar product).

Crossrefs

Cf. A011539, A087097. A133626 and A134211 are subsequences.

Programs

Formula

A011539 \ A087097. - M. F. Hasler, Nov 19 2018

A088474 Duplicate of A087097.

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
Offset: 1

Views

Author

Keywords

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

A087061 Array A(n, k) = lunar sum n + k (n >= 0, k >= 0) read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 2, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 3, 4, 5, 6, 5, 4, 3, 4, 5, 6, 7, 6, 5, 4, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 6, 7, 8, 9, 10, 11, 11, 9, 8, 7, 6, 6, 7, 8, 9, 11, 11, 12, 11, 12, 9, 8, 7, 6, 7, 8, 9, 12, 11, 12, 13, 12, 12, 13, 9, 8
Offset: 0

Views

Author

Marc LeBrun, Oct 09 2003

Keywords

Comments

There are no carries in lunar arithmetic. For each pair of lunar digits, to Add, take the lArger, but to Multiply, take the sMaller. For example:
169
+ 248
------
269
and
169
x 248
------
168
144
+ 122
--------
12468
Addition and multiplication are associative and commutative and multiplication distributes over addition. E.g., 357 * (169 + 248) = 357 * 269 = 23567 = 13567 + 23457 = (357 * 169) + (357 * 248). Note that 0 + x = x and 9*x = x for all x.
We have changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing. - N. J. A. Sloane, Aug 06 2014

Examples

			Lunar addition table A(n, k) begins:
   [0] 0  1  2  3  4  5  6  7  8  9 10 11 12 13 ...
   [1] 1  1  2  3  4  5  6  7  8  9 11 11 12 13 ...
   [2] 2  2  2  3  4  5  6  7  8  9 12 12 12 13 ...
   [3] 3  3  3  3  4  5  6  7  8  9 13 13 13 13 ...
   [4] 4  4  4  4  4  5  6  7  8  9 14 14 14 14 ...
   [5] 5  5  5  5  5  5  6  7  8  9 15 15 15 15 ...
   [6] 6  6  6  6  6  6  6  7  8  9 16 16 16 16 ...
   [7] 7  7  7  7  7  7  7  7  8  9 17 17 17 17 ...
   [8] 8  8  8  8  8  8  8  8  8  9 18 18 18 18 ...
   [9] 9  9  9  9  9  9  9  9  9  9 19 19 19 19 ...
    ...
Seen as a triangle T(n, k):
   [0] 0;
   [1] 1, 1;
   [2] 2, 1, 2;
   [3] 3, 2, 2, 3;
   [4] 4, 3, 2, 3, 4;
   [5] 5, 4, 3, 3, 4, 5;
   [6] 6, 5, 4, 3, 4, 5, 6;
   [7] 7, 6, 5, 4, 4, 5, 6, 7;
   [8] 8, 7, 6, 5, 4, 5, 6, 7, 8;
   [9] 9, 8, 7, 6, 5, 5, 6, 7, 8, 9;
		

Crossrefs

Cf. A087062 (multiplication), A087097 (primes), A004197, A003056.

Programs

  • Maple
    # Maple programs for lunar arithmetic are in A087062.
    # Seen as a triangle:
    T := (n, k) -> if n - k > k then n - k else k fi:
    for n from 0 to 9 do seq(T(n, k), k = 0..n) od; # Peter Luschny, May 07 2023
  • Mathematica
    ladd[x_, y_] := FromDigits[MapThread[Max, IntegerDigits[#, 10, Max @@ IntegerLength /@ {x, y}] & /@ {x, y}]]; Flatten[Table[ladd[k, n - k], {n, 0, 13}, {k, 0, n}]] (* Davin Park, Sep 29 2016 *)
  • PARI
    ladd=A087061(m,n)=fromdigits(vector(if(#(m=digits(m))>#n=digits(n),#n=Vec(n,-#m),#m<#n,#m=Vec(m,-#n),#n),k,max(m[k],n[k]))) \\  M. F. Hasler, Nov 12 2017, updated Nov 15 2018

Formula

T(n, k) = n - k if n - k > k, otherwise k, if seen as a triangle. See A004197, which is a kind of dual. In fact T(n, k) + A004197(n, k) = A003056(n, k). - Peter Luschny, May 07 2023

Extensions

Edited by M. F. Hasler, Nov 12 2017

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

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

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

A144171 Numbers of rank 1 in the poset of lunar numbers.

Original entry on oeis.org

8, 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
Offset: 1

Views

Author

Keywords

Comments

Consists of 8 followed by all the lunar primes (A087097).
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

Crossrefs

A144175 Numbers of rank 2 in the poset of lunar numbers.

Original entry on oeis.org

7, 18, 28, 38, 48, 58, 68, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 108, 119, 129, 139, 149, 159, 169, 179, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 208, 218, 229, 239, 249, 259, 269, 279, 289, 290, 291, 292, 293, 294, 295, 296, 297
Offset: 1

Views

Author

David Applegate, Marc LeBrun and N. J. A. Sloane, Aug 25 2010, corrected Oct 14 2010

Keywords

Crossrefs

A133626 Numbers that are lunar products of exactly 2 lunar primes.

Original entry on oeis.org

119, 129, 139, 149, 159, 169, 179, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 229, 239, 249, 259, 269, 279, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 339, 349, 359, 369, 379, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 449, 459, 469
Offset: 1

Views

Author

N. J. A. Sloane, Aug 14 2010, Aug 16 2010

Keywords

Comments

A subsequence of A087984.

Crossrefs

Showing 1-10 of 27 results. Next