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-4 of 4 results.

A115569 Lynch-Bell numbers: numbers n such that the digits are all different (and do not include 0) and n is divisible by each of its individual digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 24, 36, 48, 124, 126, 128, 132, 135, 162, 168, 175, 184, 216, 248, 264, 312, 315, 324, 384, 396, 412, 432, 612, 624, 648, 672, 728, 735, 784, 816, 824, 864, 936, 1236, 1248, 1296, 1326, 1362, 1368, 1395, 1632, 1692, 1764, 1824
Offset: 1

Views

Author

Mike Smith (mtm_king(AT)yahoo.com), Mar 10 2006; also submitted by Andy Edwards (AndynGen(AT)aol.com), Mar 20 2006

Keywords

Comments

This is a subset of some of the related sequences listed below. Stephen Lynch and Andrew Bell are Brisbane surgeons who contributed to the identification of this sequence.
There are 548 Lynch-Bell numbers. A117911 gives the number of n-digit ones. The digit 5 cannot appear in Lynch-Bell numbers containing an even digit; 5 must be the units digit when it appears. The 7-digit Lynch-Bell numbers are 105 permutations of 1289736 (the smallest such). - Rick L. Shepherd, Apr 01 2006
Can be seen/read as a table with row lengths A117911 (rows r > 7 have zero length). - M. F. Hasler, Jan 31 2016

Examples

			384/3 = 128, 384/8 = 48, 384/4 = 96. Thus 384 is Lynch-Bell as it is a multiple of each of its three distinct digits.
		

Crossrefs

Cf. A117911, A117912 (have even digits only), A117913 (have odd digits only), A010784.

Programs

  • Maple
    with(combinat):
    f:= l-> parse(cat(l[])):
    T:= n-> sort(map(f, select(l-> andmap(x-> irem(f(l), x)=0, l),
             map(p-> permute(p)[], choose([$1..9], n)))))[]:
    seq(T(n), n=1..7);  # Alois P. Heinz, Jul 31 2022
  • Mathematica
    Reap[For[n = 1, n < 10^7, n++, id = IntegerDigits[n]; If[FreeQ[id, 0] && Length[id] == Length[Union[id]] && And @@ (Divisible[n, #]& /@ id), Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Nov 26 2013 *)
    bnQ[n_]:=Max[DigitCount[n]]==1&&FreeQ[IntegerDigits[n],0]&&Union[Divisible[n,IntegerDigits[ n]]]=={True}; Select[Range[2000],lbnQ] (* Harvey P. Dale, Jun 02 2023 *)
    Cases[Union @@ ((FromDigits@#&/@Flatten[Permutations@# & /@ Subsets[Range@9, {#}], 1])&/@ Range@9), ?(DeleteDuplicates[Divisible[#, IntegerDigits@#]] == {True} &)] (* _Hans Rudolf Widmer, Aug 27 2024 *)
  • PARI
    A115569_row(n)={if(n,my(u=vectorv(n,i,10^i)\10,S=List(),M);forvec(v=vector(n,i,[1,9]),(M=lcm(v))%10==0||normlp(v,1)%3^valuation(M,3)||for(k=1,n!,vecextract(v,numtoperm(n,k))*u%M ||listput(S,vecextract(v,numtoperm(n,k))*u)),2);Set(S),concat(apply(A115569_row,[1..7])))} \\ Return terms of length n if given, else the vector of all terms. The checks M%10 and |v| % 3^v(...) are not needed but reduce CPU time by 97%. - M. F. Hasler, Jan 31 2016
    
  • PARI
    A115569(n)=n>9&&for(r=2,7,(n-=#t=A115569_row(r))>9||return(t[n-9+#t]));n \\ M. F. Hasler, Jan 31 2016
    
  • Python
    def ok(n):
        s = str(n)
        if "0" in s or len(set(s)) < len(s): return False
        return all(n%int(d) == 0 for d in s)
    afull = [k for k in range(9867313) if ok(k)]
    print(afull[:55]) # Michael S. Branicky, Jul 31 2022

Extensions

The full list of terms was sent in by Rick L. Shepherd (see link) and also by Sébastien Dumortier, Apr 04 2006

A342304 k-digit positive numbers exactly one of whose substrings is divisible by k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 23, 25, 27, 29, 41, 43, 45, 47, 49, 61, 63, 65, 67, 69, 81, 83, 85, 87, 89, 101, 104, 107, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 125, 128, 131, 134, 137, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 155, 158, 161
Offset: 1

Views

Author

Bernard Schott, Mar 08 2021

Keywords

Comments

Inspired by the 413th problem of Project Euler (see link) where such a number is called "one-child number".
There are k*(k+1)/2 substrings. All are considered, even when some are duplicates as strings or as numbers (see the Example section). 0 is always divisible by k so any number with two or more 0 digits is not a term. - Kevin Ryde, Mar 08 2021
The 2-digit terms are odd.
The number of k-digit terms for k = 1, 2, 3 is respectively 9, 20, 360.
From Robert Israel, Mar 11 2021: (Start)
5-digit terms are numbers starting with 5, and with no other digits 5 or 0.
There are no 10-digit terms. (End)

Examples

			107 is a 3-digit one-child number since among its substrings 1, 0, 7, 10, 07, 107 only 0 is divisible by 3.
222 is a 3-digit one-child number since among its substrings 2, 2, 2, 22, 22, 222 only 222 is divisible by 3.
572 is not a 3-digit one-child number, since among its substrings 5, 7, 1, 57, 72, 572 both 57 and 72 are divisible by 3.
616 is not a 3-digit one-child number, since among its substrings 6, 1, 6, 61, 16, 616 the two 6's are both divisible by 3.
		

Crossrefs

Cf. A063527.

Programs

  • Maple
    filter:= proc(n) local L,d,i,j,k, ct, x;
      L:= convert(n,base,10);
      d:= nops(L);
      ct:= 0:
      for i from 1 to d do
        for j from i to d do
          x:= add(L[k]*10^(k-i),k=i..j);
          if x mod d = 0 then ct:= ct+1; if ct = 2 then return false fi fi;
      od od;
      evalb(ct = 1)
    end proc:
    select(filter, [$1..200]); # Robert Israel, Mar 11 2021
  • Python
    def ok(n):
        s, c = str(n), 0
        ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1))
        for w in ss:
            if int(w)%len(s) == 0: c += 1
            if c == 2: return False
        return n > 0 and c == 1
    print([k for k in range(162) if ok(k)]) # Michael S. Branicky, Aug 15 2022

A116957 Lynch-Bell numbers n such that 5 is a digit of n.

Original entry on oeis.org

5, 15, 135, 175, 315, 735, 1395, 1935, 3195, 3915, 9135, 9315
Offset: 1

Views

Author

Walter Kehowski, Apr 03 2006

Keywords

Comments

A Lynch-Bell number is a positive integer n with distinct nonzero digits such that each of its digits divides the number: n mod d = 0 if d is a digit of n.

Examples

			a(3)=135 since 135 is the third Lynch-Bell number that contains a 5.
		

Crossrefs

Programs

  • Mathematica
    lbn5Q[n_]:=Module[{idn=IntegerDigits[n]},MemberQ[idn,5]&&FreeQ[idn,0]&&Max[DigitCount[n]]==1&&AllTrue[n/idn,IntegerQ]]; Select[Range[ 10000],lbn5Q] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 19 2019 *)

A116960 Lynch-Bell numbers k such that 1 is not a digit of k.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 24, 36, 48, 248, 264, 324, 384, 396, 432, 624, 648, 672, 728, 735, 784, 824, 864, 936, 2364, 2436, 3264, 3276, 3492, 3624, 3648, 3864, 3924, 4236, 4368, 4392, 4632, 4872, 4896, 4932, 4968, 6324, 6384, 6432, 6984, 8496, 8736, 9324, 9432
Offset: 1

Views

Author

Walter Kehowski, Apr 03 2006

Keywords

Comments

The Lynch-Bell numbers are those positive integers k with distinct nonzero digits such that each digit divides k: k mod d = 0 if d is a digit of k.

Examples

			a(9)=24 since it is the 9th Lynch-Bell number that does not contain a 1.
		

Crossrefs

Showing 1-4 of 4 results.