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

A038772 Numbers not divisible by any of their digits.

Original entry on oeis.org

23, 27, 29, 34, 37, 38, 43, 46, 47, 49, 53, 54, 56, 57, 58, 59, 67, 68, 69, 73, 74, 76, 78, 79, 83, 86, 87, 89, 94, 97, 98, 203, 207, 209, 223, 227, 229, 233, 239, 247, 249, 253, 257, 259, 263, 267, 269, 277, 283, 289, 293, 299, 307, 308, 323, 329, 334, 337, 338
Offset: 1

Views

Author

Henry Bottomley, May 04 2000

Keywords

Comments

A038769(a(n)) = 0; complement of A038770.
This is a regular language when written in decimal, though the minimal regular expression is probably thousands of characters long. - Charles R Greathouse IV, Aug 19 2011
Exponential density 0.954... = A104139. Asymptotically 8/35 * n^0.954... + O(n^0.903...) members up to n. - Charles R Greathouse IV, Jul 22 2012

Examples

			34 is divisible by neither 3 nor 4.
35 is excluded because 5 is a divisor of 35, but 37 is included because neither 3 nor 7 is a divisor of 37
		

Crossrefs

Cf. A327561 (counts), A038770 (complement).
Cf. also A034709, A034837, A038769.

Programs

  • Haskell
    import Data.Char (digitToInt)
    a038772 n = a038772_list !! (n-1)
    a038772_list = filter p [1..] where
       p n = all (> 0) $ map ((mod n) . digitToInt) $ filter (> '0') $ show n
    -- Reinhard Zumkeller, Jun 19 2011
    
  • Magma
    [k:k in [1..340]| forall{c:c in Set(Intseq(k)) diff {0}|k mod c ne 0}]; // Marius A. Burtea, Dec 22 2019
    
  • Mathematica
    nddQ[n_]:=Module[{idn=DeleteCases[IntegerDigits[n],0]},And@@Table[ !Divisible[n, idn[[i]]],{i,Length[idn]}]]; Select[Range[350],nddQ] (* Harvey P. Dale, Nov 01 2011 *)
  • PARI
    is(n)=my(v=vecsort(eval(Vec(Str(n))), , 8)); for(i=if(v[1], 1, 2), #v, if(n%v[i]==0, return(0))); 1 \\ Charles R Greathouse IV, Jul 22 2011
    
  • Python
    def ok(n): return not any(n%int(d) == 0 for d in str(n) if d != '0')
    print(list(filter(ok, range(1, 339)))) # Michael S. Branicky, May 20 2021

Extensions

Edited by N. J. A. Sloane, Nov 17 2008 at the suggestion of R. J. Mathar

A038770 Numbers divisible by at least one of their digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 30, 31, 32, 33, 35, 36, 39, 40, 41, 42, 44, 45, 48, 50, 51, 52, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 75, 77, 80, 81, 82, 84, 85, 88, 90, 91, 92, 93, 95, 96, 99, 100, 101, 102
Offset: 1

Views

Author

Henry Bottomley, May 04 2000

Keywords

Comments

A038769(a(n)) > 0; complement of A038772.
The decimal digit strings of this sequence are a regular language, since it is the union of A011531 and A121022 .. A121029 which are likewise regular languages. Some computer state machine manipulation for this union shows a minimum deterministic finite automaton (DFA) matching the digit strings of this sequence has 11561 states. Reversing strings (so least significant digit first) reduces to 1699 states, or reverse and allow high 0's (which become trailing 0's due to the reverse) reduces to 1424 states. The latter are tractable sizes for the linear recurrence in A327560. - Kevin Ryde, Dec 04 2019

Examples

			35 is included because 5 is a divisor of 35, but 37 is not included because neither 3 nor 7 is a divisor of 37.
		

Crossrefs

Cf. A327560 (counts), A038772 (complement), A034709, A034837, A038769.

Programs

  • Haskell
    a038770 n = a038770_list !! (n-1)
    a038770_list = filter f [1..] where
       f u = g u where
         g v = v > 0 && (((d == 0 || r > 0) && g v') || r == 0)
               where (v',d) = divMod v 10; r = mod u d
    -- Reinhard Zumkeller, Jul 30 2015, Jun 19 2011
    
  • Mathematica
    Select[Range[120],MemberQ[Divisible[#,Cases[IntegerDigits[#],Except[0]]], True]&] (* Harvey P. Dale, Jun 20 2011 *)
    Select[Range[120],AnyTrue[#/DeleteCases[IntegerDigits[#],0],IntegerQ]&] (* Harvey P. Dale, Mar 29 2024 *)
  • PARI
    is(n)=my(v=vecsort(eval(Vec(Str(n))),,8));for(i=if(v[1],1,2),#v,if(n%v[i]==0,return(1)));0 \\ Charles R Greathouse IV, Jul 22 2011
    
  • Python
    def ok(n): return any(n%int(d) == 0 for d in str(n) if d != '0')
    print(list(filter(ok, range(1, 103)))) # Michael S. Branicky, May 20 2021

Formula

a(n) ~ n. - Charles R Greathouse IV, Jul 22 2011

A038769 Number of digits of n which are divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 0, 2, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 1, 2, 0, 0, 1, 1, 1, 1, 0, 2, 1, 0, 0, 2, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 2, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 2, 1, 2, 2, 1, 2, 2
Offset: 1

Views

Author

Henry Bottomley, May 04 2000

Keywords

Comments

a(A038772(n)) = 0; a(A038770(n)) > 0.

Examples

			a(35)=1 because 5 is a divisor of 35 but 3 is not.
		

Crossrefs

Programs

  • Haskell
    import Data.Char (digitToInt)
    a038769 n = length $ filter (== 0)
                $ map ((mod n) . digitToInt) $ filter (> '0') $ show n
    -- Reinhard Zumkeller, Jun 19 2011
    
  • Magma
    [#[c:c in Intseq(k) |not IsZero(c) and k mod c eq 0]:k in [1..105]]; // Marius A. Burtea, Dec 23 2019
  • Maple
    f:= proc(n) local L; L:= convert(n,base,10);
      nops(select(t -> t > 0 and n mod t = 0, L))
    end proc:
    map(f, [$1..1000]); # Robert Israel, Jul 04 2016
  • Mathematica
    Array[Count[Position[Most@ DigitCount@ #, ?(# > 0 &)][[All, 1]], k /; Mod[#, k] == 0] &, 105] (* Michael De Vlieger, Dec 23 2019 *)
    Table[Count[n/Select[IntegerDigits[n],#>0&],?IntegerQ],{n,110}] (* _Harvey P. Dale, Mar 04 2023 *)

A132359 Numbers divisible by the square of their last decimal digit.

Original entry on oeis.org

1, 11, 12, 21, 25, 31, 32, 36, 41, 51, 52, 61, 63, 64, 71, 72, 75, 81, 91, 92, 101, 111, 112, 121, 125, 128, 131, 132, 141, 144, 147, 151, 152, 153, 161, 171, 172, 175, 181, 191, 192, 201, 211, 212, 216, 221, 224, 225, 231, 232, 241, 243, 251, 252, 261, 271, 272
Offset: 1

Views

Author

Jonathan Vos Post, Nov 08 2007

Keywords

Comments

Subsequences are A017281 and A053742 representing last digits 1 and 5. Generators for the subsequences representing last digits 2, 3, 4, 6, 7, 8 and 9 are, in that order, the terms 12+20i, 63+90i, 64+80i, 36+180i, 147+490i, 128+320i, 729+810i, where i=0,1,2,... - R. J. Mathar, Nov 13 2007
This is a 10-automatic sequence. - Charles R Greathouse IV, Dec 28 2011

Examples

			147 belongs to the sequence because 147/7^2 = 3.
		

Crossrefs

Programs

  • Maple
    isA132359 := proc(n) local ldig ; ldig := n mod 10 ; if ldig <> 0 and n mod (ldig^2) = 0 then true ; else false ; fi ; end: for n from 1 to 400 do if isA132359(n) then printf("%d,",n) ; fi ; od: # R. J. Mathar, Nov 13 2007
    a:=proc(n) local nn: nn:=convert(n,base,10): if 0 < nn[1] and `mod`(n,nn[1]^2) =0 then n else end if end proc: seq(a(n),n=1..250); # Emeric Deutsch, Nov 15 2007
  • Mathematica
    Select[Range[250], IntegerDigits[ # ][[ -1]] > 0 && Mod[ #, IntegerDigits[ # ][[ -1]]^2] == 0 &] (* Stefan Steinerberger, Nov 12 2007 *)
    dsldQ[n_]:=Module[{lidnsq=Last[IntegerDigits[n]]^2},lidnsq!=0 && Divisible[n,lidnsq]]; Select[Range[300],dsldQ] (* Harvey P. Dale, May 03 2011 *)
  • PARI
    is(n)=n%(n%10)^2==0 \\ Charles R Greathouse IV, Dec 28 2011
    
  • Python
    def ok(n): return n%10 > 0 and n%(n%10)**2 == 0
    print([k for k in range(273) if ok(k)]) # Michael S. Branicky, Jul 03 2022
  • R
    which(sapply(1:500,function(x) isint(x/(x%%10)^2))) # Christian N. K. Anderson, May 04 2013
    

Formula

Numbers k such that fp[k / (k mod 10)] = 0.
a(n) ~ 6350400*n/1241929 = 5.113...*n. - Charles R Greathouse IV, Dec 28 2011

Extensions

Corrected and extended by Stefan Steinerberger, Emeric Deutsch and R. J. Mathar, Nov 12 2007

A178157 Numbers k that are divisible by every prefix of k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 33, 36, 39, 40, 44, 48, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 330, 360, 390, 400, 420, 440, 460, 480, 500, 510, 520, 530, 540, 550, 560
Offset: 1

Views

Author

Michel Lagneau, Dec 17 2010

Keywords

Examples

			3570 is in the sequence because:
     3 | 3570;
    35 | 3570;
   357 | 3570;
  3570 | 3570.
		

Crossrefs

Cf. A034837.

Programs

  • Maple
    with(numtheory):T:=array(1..9):for n from 1 to 10000 do:ind:=0:l:=length(n):n0:=n:s:=0:for
      m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :T[m]:=u:od:for i from
      1 to l do: s1:=0:for j from 0 to i-1 do: s1:=s1 + T[l-i+j+1]*10^j :od:if irem(n,s1)=0
      then ind:=ind+1:else fi:od:if ind=l then printf(`%d, `,n):else fi:od:
  • Mathematica
    Select[Range[560],AllTrue[Table[Boole[Divisible[#,Floor[#/10^i]]],{i,0,Log10[#]}],Positive] &] (* Stefano Spezia, May 03 2025 *)

A221651 Numbers divisible by their first digit squared (excluding those whose first digit is 1).

Original entry on oeis.org

20, 24, 28, 36, 48, 50, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 256, 260, 264, 268, 272, 276, 280, 284, 288, 292, 296, 306, 315, 324, 333, 342, 351, 360, 369, 378, 387, 396, 400, 416, 432, 448, 464, 480, 496, 500, 525, 550, 575
Offset: 1

Views

Author

Keywords

Comments

Numbers where floor(n/10^floor(log(n)))^2 divides n.

Examples

			48 is divisible by 4^2.
		

Crossrefs

Programs

  • R
    x=0; y=rep(0,1000); len=0
    firstdig<-function(x) as.numeric(substr(as.character(x),1,1))
    isint<-function(x) x==as.integer(x)
    while(len<10000) if((fd=firstdig((x=x+1)))>1) if(isint(x/fd^2)) y[(len=len+1)]=x

A225297 Numbers divisible by their last digit cubed.

Original entry on oeis.org

1, 11, 21, 31, 32, 41, 51, 61, 64, 71, 72, 81, 91, 101, 111, 112, 121, 125, 131, 141, 151, 152, 161, 171, 181, 191, 192, 201, 211, 216, 221, 231, 232, 241, 243, 251, 261, 271, 272, 281, 291, 301, 311, 312, 321, 331, 341, 351, 352, 361, 371, 375, 381, 384, 391
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that (k mod 10)^3 | k.
All numbers ending in 1 are trivially included in this sequence.
The sequence is { 1+10k, 32 + 40k, 243 + 270k, 64 + 320k, 125 + 250k, 216 + 1080k, 3087 + 3430k, 2048 + 2560k, 729 + 7290k ; k = 0,1,2,...}. - M. F. Hasler, Jan 31 2016
The asymptotic density of this sequence is 2201597407/16003008000 = 0.137573... . - Amiram Eldar, Aug 08 2023

Examples

			a(16) = 112 is divisible by 2^3.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[400], (m = Mod[#, 10]) > 0 && Divisible[#, m^3] &] (* Amiram Eldar, Aug 08 2023 *)
  • PARI
    is(n)=n%10&&n%(n%10)^3==0 \\ M. F. Hasler, Jan 31 2016
  • R
    x=0; y=rep(0,100); len=0; isint<-function(x) x==as.integer(x); while(len<100) if((x=x+1)%%10>0) if(isint(x/(x%%10)^3)) y[(len=len+1)]=x
    

A225296 Numbers divisible by their first digit cubed (excluding those whose first digit is 1).

Original entry on oeis.org

24, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, 288, 296, 324, 351, 378, 448, 500, 648, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, 2064, 2072, 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2200, 2208
Offset: 1

Views

Author

Keywords

Comments

Numbers where floor(n/10^floor(log(n)))^3 | n.

Examples

			448 is divisible by 4^3.
		

Crossrefs

Programs

  • Mathematica
    dfdcQ[n_]:=Module[{fidn=IntegerDigits[n][[1]]},fidn!=1&&Divisible[ n,fidn^3]]; Select[Range[2500],dfdcQ] (* Harvey P. Dale, Jan 13 2019 *)
  • R
    x=0; y=rep(0,1000); len=0
    firstdig<-function(x) as.numeric(substr(as.character(x),1,1))
    isint<-function(x) x==as.integer(x)
    while(len<1000) if((fd=firstdig((x=x+1)))>1) if(isint(x/fd^3)) y[(len=len+1)]=x

A225722 Numbers divisible by their last digit cubed, excluding those whose last digit is 1.

Original entry on oeis.org

32, 64, 72, 112, 125, 152, 192, 216, 232, 243, 272, 312, 352, 375, 384, 392, 432, 472, 512, 513, 552, 592, 625, 632, 672, 704, 712, 729, 752, 783, 792, 832, 872, 875, 912, 952, 992, 1024, 1032, 1053, 1072, 1112, 1125, 1152, 1192, 1232, 1272, 1296, 1312, 1323
Offset: 1

Views

Author

Keywords

Comments

a(n) ~ n. For 69 < n < 10000, the formula 26.61*n - 2.76 provides an estimate of a(n) to within 1%.
The asymptotic density of this sequence is 601296607/16003008000 = 0.037573... . Therefore, contrary to the above comment, a(n) ~ c*n where c = 16003008000/601296607 = 26.614166... . - Amiram Eldar, Aug 08 2023

Examples

			a(5) = 125 is an example because its last digit is 5, and 5^3 = 125, and 125 is divisible by 125.
		

Crossrefs

Programs

  • Mathematica
    dldcQ[n_]:=Module[{ld=Last[IntegerDigits[n]]},ld>1&&Divisible[n,ld^3]]; Select[Range[1500],dldcQ] (* Harvey P. Dale, Aug 15 2014 *)
  • R
    which(sapply(1:1000,function(x) x%%10>1 & (v=x/(x%%10)^3)==as.integer(v) ))

A225299 Numbers divisible by the square of each digit.

Original entry on oeis.org

1, 11, 12, 36, 111, 112, 128, 144, 212, 216, 224, 333, 432, 448, 612, 1111, 1112, 1116, 1212, 1296, 1332, 1424, 2112, 2144, 2212, 2224, 2232, 2916, 3132, 3312, 3636, 4112, 4144, 4224, 4288, 4464, 6336, 6624, 8128, 8448, 9396, 11111, 11112, 11133, 11172, 11212
Offset: 1

Views

Author

Keywords

Comments

Includes all repunits.

Examples

			a(7) 128 is divisible by 1^2, by 2^2, and by 8^2.
		

Crossrefs

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; t={}; Do[If[!MemberQ[d[n],0] && Union[Mod[n,d[n]^2]] == {0}, AppendTo[t,n]], {n,11220}]; t (* Jayanta Basu, May 15 2013 *)
    Select[Range[12000],DigitCount[#,10,0]==0&&And@@Divisible[ #,IntegerDigits[ #]^2]&] (* Harvey P. Dale, Jul 16 2018 *)
  • R
    isint<-function(x) x==as.integer(x)
    sqalldig<-function(x) as.numeric(strsplit(as.character(x),"")[[1]])^2
    divby<-function(x) ifelse(length(grep(0,x))>0,F,all(isint(x/sqalldig(x))))
    which(sapply(1:1000,divby))
Showing 1-10 of 19 results. Next