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

A333456 a(n) is the smallest number with exactly n divisors that are Niven numbers.

Original entry on oeis.org

1, 2, 4, 6, 45, 12, 30, 24, 36, 84, 60, 72, 400, 144, 120, 216, 180, 240, 420, 504, 600, 960, 360, 900, 840, 1200, 1512, 720, 1620, 4500, 1080, 2700, 1800, 3024, 3360, 2880, 3960, 2160, 3240, 5760, 2520, 6720, 4320, 5400, 9360, 7920, 7200, 6480, 13860, 8640
Offset: 1

Views

Author

Marius A. Burtea, May 03 2020

Keywords

Comments

A Niven number (A005349) is a number that is divisible by the sum of its digits; e.g., 12 is a Niven number because it's divisible by 1 + 2.
The divisor 1 is trivially a Niven number. For a number n, the divisor n itself is considered
Conjecture: For every n there is at least one number k with n divisors Niven numbers.
Not all terms in the sequence are Niven numbers. For example: a(85) = 85680 has digsum(85680) = 27 and 85680/27 = 3173.33 ...
Also, a(152) = 856800, a(159) = 887040, a(161) = 2096640.
The number of non-Niven terms can be infinite.

Examples

			Of the divisors of 45, only five are Niven numbers: 1, 3, 5, 9, and 45.
Number 12 has all six divisors 1, 2, 3, 4, 6 and 12 that are Niven numbers.
		

Crossrefs

Programs

  • Magma
    a:=[]; for n in [1..50] do m:=1; while #[d:d in Divisors(m)|d mod &+Intseq(d) eq 0] ne n do m:=m+1; end while; Append(~a,m); end for; a;
    
  • Mathematica
    numDiv[n_] := DivisorSum[n, 1 &, Divisible[#, Plus @@ IntegerDigits[#]] &]; a[n_] := Module[{k = 1}, While[numDiv[k] != n, k++]; k]; Array[a, 50] (* Amiram Eldar, May 04 2020 *)
  • PARI
    f(n) = sumdiv(n, d, !(d % sumdigits(d))); \\ A332268
    a(n) = my(k=1); while (f(k) != n, k++); k; \\ Michel Marcus, May 04 2020

A356018 a(n) is the number of evil divisors (A001969) of n.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 0, 2, 2, 0, 3, 0, 0, 3, 0, 1, 4, 0, 3, 1, 0, 1, 4, 1, 0, 3, 0, 1, 6, 0, 0, 2, 2, 1, 6, 0, 0, 2, 4, 0, 2, 1, 0, 5, 2, 0, 5, 0, 2, 3, 0, 1, 6, 1, 0, 2, 2, 0, 9, 0, 0, 3, 0, 2, 4, 0, 3, 2, 2, 1, 8, 0, 0, 4, 0, 1, 4, 0, 5, 3, 0, 1, 3, 3, 2
Offset: 1

Views

Author

Bernard Schott, Jul 23 2022

Keywords

Comments

a(n) = 0 iff n is in A093696.

Examples

			12 has 6 divisors: {1, 2, 3, 4, 6, 12} of which three {3, 6, 12} have an even number of 1's in their binary expansion with 11, 110 and 11100 respectively; hence a(12) = 3.
		

Crossrefs

Cf. A000005, A001969, A093688, A093696 (location of 0s), A227872, A356019, A356020.
Similar sequences: A083230, A087990, A087991, A332268, A355302.

Programs

  • Maple
    A356018 := proc(n)
        local a,d ;
        a := 0 ;
        for d in numtheory[divisors](n) do
            if isA001969(d) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A356018(n),n=1..200) ;  # R. J. Mathar, Aug 07 2022
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, EvenQ[DigitCount[#, 2, 1]] &]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
  • PARI
    a(n) = my(v = valuation(n, 2)); n>>=v; d=divisors(n); sum(i=1, #d, bitand(hammingweight(d[i]), 1) == 0) * (v+1) \\ David A. Corneth, Jul 23 2022
  • Python
    from sympy import divisors
    def c(n): return bin(n).count("1")&1 == 0
    def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 23 2022
    

Formula

a(n) = A000005(n) - A227872(n).

Extensions

More terms from David A. Corneth, Jul 23 2022

A337741 Numbers all of whose divisors are Niven numbers (A005349).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 36, 40, 54, 63, 72, 81, 108, 162, 216, 243, 324, 486, 648, 972, 1944
Offset: 1

Views

Author

Amiram Eldar, Sep 17 2020

Keywords

Comments

Since the only prime Niven numbers are the single-digit primes 2, 3, 5 and 7, all the terms are 7-smooth numbers (A002473).
If k is a term, all the divisors of k are also terms. Since all the terms are 7-smooth, every term is of the form p * k, where p is in {2, 3, 5, 7} and k is a smaller term. Thus it is easy to verify that there are only 31 terms in this sequence, and 1944 being the last term.

Examples

			6 is a term since all the divisors of 6, i.e., 1, 2, 3 and 6, are Niven numbers.
		

Crossrefs

Subsequence of A002473 and A005349.
Similar sequences: A062687, A190217, A329419.

Programs

  • Mathematica
    nivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; allQ[n_] := AllTrue[Divisors[n], nivenQ]; p = {1, 2, 3, 5, 7}; s = {1}; n = 0; While[Length[s] != n, n = Length[s]; s = Select[Union @ Flatten @ Outer[Times, s, p], allQ]]; s

A355593 a(n) is the number of alternating integers that divide n.

Original entry on oeis.org

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

Views

Author

Bernard Schott, Jul 08 2022

Keywords

Comments

This sequence first differs from A355302 at index 13, where a(13) = 1 while A355302(13) = 2.
This sequence first differs from A332268 at index 14, where a(14) = 4 while A332268(14) = 3.

Examples

			40 has 8 divisors: {1, 2, 4, 5, 8, 10, 20, 40} of which 2 are not alternating integers: {20, 40}, hence a(40) = 8 - 2 = 6.
		

Crossrefs

Cf. A030141 (alternating integers), A355594, A355595, A355596.
Similar to A332268 (with Niven numbers) and A355302 (with undulating integers).

Programs

  • Maple
    Alt:= [$1..9, seq(seq(10*i+r - (i mod 2), r=[1,3,5,7,9]),i=1..9)]:
    V:= Vector(100):
    for t in Alt do J:= [seq(i,i=t..100,t)]; V[J]:= V[J] +~ 1 od:
    convert(V,list); # Robert Israel, Nov 26 2023
  • Mathematica
    q[n_] := !MemberQ[Differences[Mod[IntegerDigits[n], 2]], 0]; a[n_] := DivisorSum[n, 1 &, q[#] &]; Array[a, 120] (* Amiram Eldar, Jul 08 2022 *)
  • PARI
    alternate(n,d=digits(n))=for(i=2,#d, if((d[i]-d[i-1])%2==0, return(0))); 1
    a(n)=sumdiv(n,d,alternate(d)) \\ Charles R Greathouse IV, Jul 08 2022
  • Python
    from sympy import divisors
    def p(d): return 0 if d in "02468" else 1
    def c(n):
        if n < 10: return True
        s = str(n)
        return all(p(s[i]) != p(s[i+1]) for i in range(len(s)-1))
    def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 08 2022
    

Formula

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{n>=2} 1/A030141(n) = 5.1... (the sums up to 10^10, 10^11 and 10^12 are 5.1704..., 5.1727... and 5.1738..., respectively). - Amiram Eldar, Jan 06 2024

A335037 a(n) is the number of divisors of n that are themselves divisible by the product of their digits.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 3, 3, 2, 6, 1, 3, 4, 4, 1, 5, 1, 4, 3, 3, 1, 8, 2, 2, 3, 4, 1, 6, 1, 4, 3, 2, 3, 8, 1, 2, 2, 5, 1, 5, 1, 4, 5, 2, 1, 8, 2, 3, 2, 3, 1, 5, 3, 5, 2, 2, 1, 8, 1, 2, 4, 4, 2, 5, 1, 3, 2, 4, 1, 10, 1, 2, 4, 3, 3, 4, 1, 5, 3, 2, 1, 7, 2, 2, 2, 5
Offset: 1

Views

Author

Bernard Schott, Jun 03 2020

Keywords

Comments

Inspired by A332268.
A number that is divisible by the product of its digits is called Zuckerman number (A007602); e.g., 24 is a Zuckerman number because it is divisible by 2*4=8 (see links).
a(n) = 1 iff n = 1 or n is prime not repunit >= 13.
a(n) = 2 iff n is prime = 2, 3, 5, 7 or a prime repunit.
Numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 24, 111111111111111111111 (repunit with 19 times 1's) have all divisors Zuckerman numbers. The sequence of numbers with all Zuckerman divisors is infinite iff there are infinitely many repunit primes (see A004023).

Examples

			For n = 4, the divisors are 1, 2, 4 and they are all Zuckerman numbers, so a(4) = 3.
For n = 14, the divisors are 1, 2, 7 and 14. Only 1, 2 and 7 are Zuckerman numbers, so a(14) = 3.
		

Crossrefs

Similar with: A001227 (odd divisors), A087990 (palindromic divisors), A087991 (non-palindromic divisors), A242627 (divisors < 10), A332268 (Niven divisors).

Programs

  • Mathematica
    zuckQ[n_] := (prodig = Times @@ IntegerDigits[n]) > 0&& Divisible[n, prodig]; a[n_] := Count[Divisors[n], ?(zuckQ[#] &)]; Array[a, 100] (* _Amiram Eldar, Jun 03 2020 *)
  • PARI
    iszu(n) = my(p=vecprod(digits(n))); p && !(n % p);
    a(n) = sumdiv(n, d, iszu(d)); \\ Michel Marcus, Jun 03 2020

Formula

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{n>=1} 1/A007602(n) = 3.26046... . - Amiram Eldar, Jan 01 2024

A355770 a(n) is the number of terms of A333369 that divide n.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 1, 2, 2, 2, 4, 1, 2, 3, 2, 2, 3, 2, 1, 2, 2, 2, 3, 2, 1, 4, 2, 1, 2, 2, 4, 3, 2, 2, 4, 2, 1, 3, 1, 3, 5, 1, 1, 2, 2, 2, 4, 2, 2, 3, 2, 2, 4, 1, 2, 4, 1, 2, 4, 1, 3, 4, 1, 2, 2, 4, 2, 3, 2, 2, 5, 2, 2, 4, 2, 2, 3, 1, 1, 3, 3, 1, 2
Offset: 1

Views

Author

Bernard Schott, Jul 16 2022

Keywords

Crossrefs

Programs

  • Mathematica
    q[n_] := AllTrue[Tally @ IntegerDigits[n], EvenQ[Plus @@ #] &]; a[n_] := DivisorSum[n, 1 &, q[#] &]; Array[a, 100] (* Amiram Eldar, Jul 16 2022 *)
  • PARI
    issimber(m) = my(d=digits(m), s=Set(d)); for (i=1, #s, if (#select(x->(x==s[i]), d) % 2 != (s[i] % 2), return (0))); return (1); \\ A333369
    a(n) = sumdiv(n, d, issimber(d)); \\ Michel Marcus, Jul 18 2022
  • Python
    from sympy import divisors
    def c(n): s = str(n); return all(s.count(d)%2 == int(d)%2 for d in set(s))
    def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Jul 16 2022
    

Extensions

More terms from Michael S. Branicky, Jul 16 2022

A340637 Integers whose number of divisors that are Niven numbers sets a new record.

Original entry on oeis.org

1, 2, 4, 6, 12, 24, 36, 60, 72, 120, 180, 240, 360, 720, 1080, 1800, 2160, 2520, 4320, 5040, 7560, 10080, 15120, 20160, 25200, 30240, 45360, 50400, 60480, 75600, 90720, 100800, 110880, 120960, 151200, 166320, 221760, 277200, 302400, 332640, 453600, 498960, 554400
Offset: 1

Views

Author

Bernard Schott, Jan 14 2021

Keywords

Comments

A Niven number (A005349) is a number that is divisible by the sum of its digits.
The first 13 terms are the first 13 terms of A236021, then A236021(14) = 420 while a(14) = 720.

Examples

			The 8 divisors of 24 are all Niven numbers, and also, 24 is the smallest integer that has at least 8 divisors that are Niven numbers, hence 24 is a term.
		

Crossrefs

Subsequence of A333456.
Similar for palindromes (A093036), repdigits (A340548), repunits (A340549), Zuckerman numbers (A340638).

Programs

  • Mathematica
    s[n_] := DivisorSum[n, 1 &, Divisible[#, Plus @@ IntegerDigits[#]] &]; smax = 0; seq = {}; Do[s1 = s[n]; If[s1 > smax, smax = s1; AppendTo[seq, n]], {n, 1, 10^6}]; seq (* Amiram Eldar, Jan 14 2021 *)
  • PARI
    f(n) = sumdiv(n, d, !(d % sumdigits(d))); \\ A332268
    lista(nn) = {my(m=0); for (n=1, nn, my(x = f(n)); if (x > m, m = x; print1(n, ", ")););} \\ Michel Marcus, Jan 14 2021

Extensions

More terms from Amiram Eldar, Jan 14 2021

A355698 a(n) is the number of repdigits divisors of n (A010785).

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 3, 3, 2, 5, 1, 3, 3, 4, 1, 5, 1, 4, 3, 4, 1, 6, 2, 2, 3, 4, 1, 5, 1, 4, 4, 2, 3, 6, 1, 2, 2, 5, 1, 5, 1, 6, 4, 2, 1, 6, 2, 3, 2, 3, 1, 5, 4, 5, 2, 2, 1, 6, 1, 2, 4, 4, 2, 8, 1, 3, 2, 4, 1, 7, 1, 2, 3, 3, 4, 4, 1, 5, 3, 2, 1, 6, 2, 2, 2, 8, 1, 6, 2, 3, 2, 2, 2, 6, 1, 3, 6, 4, 1, 4, 1, 4, 4
Offset: 1

Views

Author

Bernard Schott, Jul 14 2022

Keywords

Comments

More than the usual number of terms are displayed in order to show the difference from A087990.
The first 100 terms are the same first 100 terms of A087990, then a(101) = 1 while A087990(101) = 2, because 101 is the smallest palindrome that is not repdigit; the next difference is 121.
Inequalities: 1 <= a(n) <= A087990(n).

Examples

			66 has 8 divisors: {1, 2, 3, 6, 11, 22, 33, 66} that are all repdigits, hence a(66) = 8.
121 has 3 divisors: {1, 11, 121} of which 2 are repdigits: {1, 11}, hence a(121) = 2.
		

Crossrefs

Programs

  • Maple
    isrepdig:= proc(n) nops(convert(convert(n,base,10),set))=1 end proc:
    f:= proc(n) nops(select(isrepdig, numtheory:-divisors(n))) end proc:
    map(f, [$1..200]); # Robert Israel, Aug 07 2024
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, Length[Union[IntegerDigits[#]]] == 1 &]; Array[a, 100] (* Amiram Eldar, Jul 14 2022 *)
  • PARI
    a(n) = my(ret=0,u=1); while(u<=n, ret+=sum(d=1,9, n%(u*d)==0); u=10*u+1); ret; \\ Kevin Ryde, Jul 14 2022
    
  • PARI
    isrep(n) = {1==#Set(digits(n))}; \\ A010785
    a(n) = sumdiv(n, d, isrep(d)); \\ Michel Marcus, Jul 15 2022
  • Python
    from sympy import divisors
    def c(n): return len(set(str(n))) == 1
    def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    print([a(n) for n in range(1, 105)]) # Michael S. Branicky, Jul 14 2022
    

Formula

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = (7129/2520) * A065444 = 3.11446261209177581335... . - Amiram Eldar, Apr 17 2025

A360074 a(n) is the greatest divisor of n divisible by the sum of its own digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 12, 1, 7, 5, 8, 1, 18, 1, 20, 21, 2, 1, 24, 5, 2, 27, 7, 1, 30, 1, 8, 3, 2, 7, 36, 1, 2, 3, 40, 1, 42, 1, 4, 45, 2, 1, 48, 7, 50, 3, 4, 1, 54, 5, 8, 3, 2, 1, 60, 1, 2, 63, 8, 5, 6, 1, 4, 3, 70, 1, 72, 1, 2, 5, 4, 7, 6, 1, 80
Offset: 1

Views

Author

Rémy Sigrist, Jan 24 2023

Keywords

Comments

Numbers divisible by the sum of their digits are called Niven (or Harshad, or harshad) numbers (A007602).

Examples

			For n = 32:
- the divisors of 32 are 1, 2, 4, 8, 16 and 32,
- 8 is divisible by 8 whereas 16 is not divisible by 1+6 and 32 is not divisible by 3+2,
- so a(32) = 8.
		

Crossrefs

Programs

  • Mathematica
    Table[Max[Select[Divisors[n],Mod[#,Total[IntegerDigits[#]]]==0&]],{n,80}] (* Harvey P. Dale, Sep 04 2023 *)
  • PARI
    a(n) = fordiv (n, d, my (t=n/d); if (t%sumdigits(t)==0, return (t)))

Formula

a(n) = n iff n belongs to A005349.
Showing 1-9 of 9 results.