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

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

A330348 a(n) is the number of divisors of n whose last digit equals the last digit 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, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 3, 2, 2, 1, 2, 3, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 4, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 3, 1, 1, 4, 1, 2, 1, 1, 4, 2, 2, 1, 3, 2, 1, 1, 2, 1
Offset: 1

Views

Author

Bernard Schott, Jun 04 2020

Keywords

Comments

Inspired by Project Euler, Problem 474 (see link).
a(n) >= 1.
When n > 10 ends with 0, 1, 2 or 5, then a(n) >= 2.
The first 19 terms are the same as A038769, but a(20) = 2 and A038769(20) = 1.
From Robert Israel, Jun 04 2020: (Start)
a(10*n) = A000005(n).
If n is odd, then a(2*n) = a(n) and a(5*n) = A000005(n). (End)
Integers all of whose divisors end with the same last digit (which is necessarily 1) are in A004615. - Bernard Schott, May 07 2021

Examples

			The divisors of 12 that end in 2 are 2 and 12, so a(12) = 2.
		

Crossrefs

Cf. A000005 (number of divisors), A004615, A010879 (last digit of n), A038769.

Programs

  • Maple
    f:= proc(n) local t;
    t:= n mod 10;
    nops(select(k -> k mod 10 = t, numtheory:-divisors(n)))
    end proc:
    map(f, [$1..100]); # Robert Israel, Jun 04 2020
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, Mod[# - n, 10] == 0 &]; Array[a, 100] (* Amiram Eldar, Jun 04 2020 *)
  • PARI
    a(n) = my(u=n%10); sumdiv(n, d, d%10 == u); \\ Michel Marcus, Jun 04 2020
    
  • Python
    from sympy import divisors
    def a(n): return sum((n-d)%10 == 0 for d in divisors(n, generator=True))
    print([a(n) for n in range(1, 90)]) # Michael S. Branicky, Aug 15 2022

A055639 Number of nonzero digits of n which are not factors of n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jun 06 2000

Keywords

Crossrefs

Programs

A176659 Partial sums of A038770.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 277, 302, 328, 356, 386, 417, 449, 482, 517, 553, 592, 632, 673, 715, 759, 804, 852, 902, 953, 1005, 1060, 1120, 1181, 1243, 1306, 1370, 1435, 1501, 1571, 1642
Offset: 1

Views

Author

Jonathan Vos Post, Apr 23 2010

Keywords

Comments

Partial sums of numbers divisible by at least one of their digits. Identical to triangular numbers A000217 until a(23), then differs, because 23 is the smallest natural number in the complement of A038770 (A038772, i.e., not divisible by at least one of its digits). Hence this partial sum is the triangular numbers minus the partial sums of A038772, properly offset. The subsequence of primes (of course 3 is the largest prime triangular number) in the partial sum begins: 3, 277, 449, 673, 953, 1181, 1571, 1789, 2027. What are the equivalents in bases other than 10?

Examples

			a(23) = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 24 = 277 is prime.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Select[Range[110],MemberQ[Divisible[#,Cases[ IntegerDigits[ #], Except[ 0]]], True]&]] (* Harvey P. Dale, May 11 2017 *)

Formula

a(n) = Sum_{i=1..n} A038770(i).

A188454 Numbers n whose decimal digits are distinct and no digit divides n.

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, 239, 247, 249, 253, 257, 259, 263, 267, 269, 283, 289, 293, 307, 308, 329, 346, 347, 349, 356, 358, 359, 367, 370, 374
Offset: 1

Views

Author

Andy Edwards, Mar 31 2011

Keywords

Comments

These may not contain 1 or have a 2 or 5 as the last digit. They include prime numbers not containing the digit 1 and composites with a smallest prime factor > 10 and obeying the other constraints (e.g. the largest case is 987654203 = 31*31859813).
The first even case is 34. The first consecutive pair is {37, 38}. {56,57,58,59} is a consecutive quadruple which is the maximal size for such a subset.
There are 202623 terms in this sequence. - Nathaniel Johnston, May 19 2011

Crossrefs

Programs

  • Mathematica
    dddQ[n_]:=Module[{dcn=DigitCount[n]},Max[dcn]==1&&First[dcn]==0 && Union[ Divisible[n,Select[IntegerDigits[n],#!=0&]]]=={False}]; Select[Range[ 400],dddQ] (* Harvey P. Dale, May 01 2012 *)

A176660 Partial sums of A038772.

Original entry on oeis.org

23, 50, 79, 113, 150, 188, 231, 277, 324, 373, 426, 480, 536, 593, 651, 710, 777, 845, 914, 987, 1061, 1137, 1215, 1294, 1377, 1463, 1550, 1639, 1733, 1830, 1928, 2131, 2338, 2547, 2770, 2997, 3226, 3459, 3698, 3945, 4194, 4447, 4704, 4963, 5226, 5493
Offset: 1

Views

Author

Jonathan Vos Post, Apr 23 2010

Keywords

Comments

Partial sums of numbers not divisible by any of their digits. The partial sums of the complement (A038770, numbers divisible by at least one of their digits) is A176659. Hence the sum of the two partial sums (properly offset) is triangular numbers A000217. The subsequence of primes in the partial sum begins: 23, 79, 113, 277, 373, 593, 1061, 1733, 2131, 4447, 9479. The smallest square in the sequence is 324.

Examples

			a(4) = 23 + 27 + 29 + 34 = 113 is prime.
		

Crossrefs

Formula

a(n) = SUM[i=1..n] A038772(i).
Showing 1-7 of 7 results.