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

A113315 Niven (or Harshad) numbers A005349 divided by the sum of their digits.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 4, 2, 10, 7, 4, 3, 10, 4, 10, 7, 5, 4, 10, 6, 10, 7, 10, 8, 10, 9, 7, 10, 100, 34, 12, 55, 37, 28, 19, 13, 40, 14, 22, 19, 15, 28, 16, 25, 19, 17, 13, 18, 19, 20, 19, 16, 13, 11, 100, 67, 34, 23, 19, 70, 24, 55, 37, 28, 25, 19, 46, 26, 40, 27, 19, 28, 29
Offset: 1

Views

Author

Amarnath Murthy, Dec 20 2001

Keywords

Comments

a(n)=10234 is particularly frequent, it is obtained by the following integers: 102340, 133042, 153510, 184212, 204680, 214914, 225148, 235382, 245616, 255850, 266084, 276318, 286552, 327488, 347956, 378658, 388892,.... Carmine Suriano, May 04 2013

Examples

			12 is the 11th term of A005349, hence a(11) = 12/(1+2) = 4.
		

Crossrefs

Cf. A005349 (Niven (or Harshad) numbers: numbers that are divisible by the sum of their digits). Cf. also A066355.

Programs

  • Mathematica
    Select[# / DigitSum[#] & /@ Range[300], IntegerQ] (* Amiram Eldar, May 26 2024 *)
  • PARI
    lista(nn) = {for (i = 1, nn, if (i % sumdigits(i) == 0, print1(i/sumdigits(i), ", ")););} \\ Michel Marcus, Oct 09 2013

Formula

a(n) = A005349(n)/A007953(A005349(n)). - Michel Marcus, Oct 09 2013

Extensions

Corrected, extended and edited by Zak Seidov, Oct 26 2005

A330928 Starts of runs of 5 consecutive Niven (or harshad) numbers (A005349).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 131052, 491424, 1275140, 1310412, 1474224, 1614623, 1912700, 2031132, 2142014, 2457024, 2550260, 3229223, 3931224, 4422624, 4914024, 5405424, 5654912, 5920222, 7013180, 7125325, 7371024, 8073023, 8347710, 9424832, 10000095, 10000096, 10000097
Offset: 1

Views

Author

Amiram Eldar, Jan 03 2020

Keywords

Comments

Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite.

Examples

			131052 is a term since 131052 is divisible by 1 + 3 + 1 + 0 + 5 + 2 = 12, 131053 is divisible by 13, 131054 is divisible by 14, 131055 is divisible by 15, and 131056 is divisible by 16.
		

References

  • Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110.

Crossrefs

Cf. A005349, A060159; A330927, A154701, A141769, A330929, A330930 (same for 2, 3, 4, 6, 7 consecutive harshad numbers).

Programs

  • Magma
    f:=func; a:=[]; for k in [1..11000000] do  if forall{m:m in [0..4]|f(k+m)} then Append(~a,k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
    
  • Mathematica
    nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; niv = nivenQ /@ Range[5]; seq = {}; Do[niv = Join[Rest[niv], {nivenQ[k]}]; If[And @@ niv, AppendTo[seq, k - 4]], {k, 5, 10^7}]; seq
    SequencePosition[Table[If[Divisible[n,Total[IntegerDigits[n]]],1,0],{n,10^7+200}],{1,1,1,1,1}][[;;,1]] (* Harvey P. Dale, Dec 24 2023 *)
  • PARI
    {first( N=50, LEN=5, L=List())= for(n=1,oo, n+=LEN; for(m=1,LEN, n--%sumdigits(n) && next(2)); listput(L,n); N--|| break);L} \\ M. F. Hasler, Jan 03 2022

Formula

This A330928 = { A005349(k) | A005349(k+4) = A005349(k)+4 }. - M. F. Hasler, Jan 03 2022

A330929 Starts of runs of 6 consecutive Niven (or Harshad) numbers (A005349).

Original entry on oeis.org

1, 2, 3, 4, 5, 10000095, 10000096, 12751220, 14250624, 22314620, 22604423, 25502420, 28501224, 35521222, 41441420, 41441421, 51004820, 56511023, 57002424, 70131620, 71042422, 71253024, 97740760, 102009620, 111573020, 114004824, 121136420, 124324220, 124324221
Offset: 1

Views

Author

Amiram Eldar, Jan 03 2020

Keywords

Comments

Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite.

Examples

			10000095 is a term since 10000095 is divisible by 1 + 0 + 0 + 0 + 0 + 0 + 9 + 5 = 15, 10000096 is divisible by 16, ..., and 10000100 is divisible by 2.
		

References

  • Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110.

Crossrefs

Programs

  • Magma
    f:=func; a:=[]; for k in [1..30000000] do  if forall{m:m in [0..5]|f(k+m)} then Append(~a,k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
  • Mathematica
    nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; niv = nivenQ /@ Range[6]; seq = {}; Do[niv = Join[Rest[niv], {nivenQ[k]}]; If[And @@ niv, AppendTo[seq, k - 5]], {k, 6, 10^7}]; seq

A330930 Starts of runs of 7 consecutive Niven (or Harshad) numbers (A005349).

Original entry on oeis.org

1, 2, 3, 4, 10000095, 41441420, 124324220, 124324221, 124324222, 207207020, 233735070, 331531220, 350602590, 409036350, 414414020, 467470110, 621621020, 621621021, 621621022, 1030302012, 1036035020, 1051807710, 1201800620, 1243242020, 1243242021, 1243242022
Offset: 1

Views

Author

Amiram Eldar, Jan 03 2020

Keywords

Comments

Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite.

Examples

			10000095 is a term since 10000095 is divisible by 1 + 0 + 0 + 0 + 0 + 0 + 9 + 5 = 15, 10000096 is divisible by 16, ..., and 10000101 is divisible by 3.
		

References

  • Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110.

Crossrefs

Programs

  • Mathematica
    nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; niv = nivenQ /@ Range[7]; seq = {}; Do[niv = Join[Rest[niv], {nivenQ[k]}]; If[And @@ niv, AppendTo[seq, k - 6]], {k, 7, 10^7}]; seq

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

A337076 Niven numbers (A005349) with a record gap to the next Niven number.

Original entry on oeis.org

1, 10, 12, 63, 72, 90, 288, 378, 558, 2889, 3784, 6480, 19872, 28971, 38772, 297864, 478764, 589860, 989867, 2879865, 9898956, 49989744, 88996914, 689988915, 879987906, 989888823, 2998895823, 6998899824, 8889999624, 8988988866, 9879997824, 18879988824, 286889989806
Offset: 1

Views

Author

Amiram Eldar, Aug 14 2020

Keywords

Comments

The corresponding record gaps are 1, 2, 6, 7, 8, 10, 12, 14, 18, 23, 32, 36, 44, 45, 54, 60, 66, 72, 88, 90, 99, 108, 126, 135, 144, 150, 153, 192, 201, 234, 258, 276, 294, ...
Kennedy and Cooper (1984) proved that the asymptotic density of the Niven numbers is 0. Therefore, this sequence is infinite.
De Koninck and Doyon proved that for sufficiently large k the least number m such that the interval[m, m+k-1] does not contain any Niven numbers is < (100*(k+2))^(k+3).

Examples

			10 is a term since it is a Niven number, and the next Niven number is 12, with a gap 12 - 10 = 2, which is a record, since all the numbers below 10 are also Niven numbers.
		

Crossrefs

Programs

  • Mathematica
    nivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; gapmax = 0; n1 = 1; s = {}; Do[If[nivenQ[n], gap = n - n1; If[gap > gapmax, gapmax = gap; AppendTo[s, n1]]; n1 = n], {n, 2, 10^6}]; s

A128702 Highly abundant numbers (A002093) that are not Harshad numbers (A005349).

Original entry on oeis.org

16, 96, 168, 47880, 85680, 95760, 388080, 458640, 526680, 609840, 637560, 776160, 887040, 917280, 942480, 1219680, 1244880, 1607760, 1774080, 2439360, 3880800, 5266800, 5569200, 6098400, 7761600, 9424800, 12196800, 17907120, 20900880
Offset: 1

Views

Author

Ant King, Mar 28 2007

Keywords

Comments

All superabundant numbers (A004394), colossally abundant numbers (A004490), highly composite numbers (A002182) and superior highly composite numbers (A002201) are Harshad numbers. However, this is not true of the highly abundant numbers (A002093) and there are 32 exceptions in the 394 highly abundant numbers less than 50 million.
The previous comment is erroneous. The first superabundant number that is not a Harshad number is A004394(105) = 149602080797769600. The first highly composite number that is not a Harshad number is A002182(61) = 245044800. For all exceptions I found, the sum of digits is a power of 3. Although the first 60000 terms of the colossally abundant numbers and the superior highly composite numbers are Harshad numbers, I am not aware of a proof that all terms are Harshad numbers. There may be large counterexamples. [T. D. Noe, Oct 27 2009]

Examples

			The third highly abundant number that is not a Harshad number is 168. So a(3)=168.
		

Crossrefs

Programs

  • Mathematica
    hadata1=FoldList[Max,1,Table[DivisorSigma[1,n],{n,2,10^6}]]; data1=Flatten[Position[hadata1,#,1,1]&/@Union[hadata1]];HarshadQ[k_]:=If[IntegerQ[ k/(Plus @@ IntegerDigits[ k ])],True,False];Select[data1,!HarshadQ[ # ] &]

Formula

The highly abundant numbers (A002093) are those values of n for which sigma(n)>sigma(m) for all mA000203(n). Harshad numbers (A005349) are divisible by the sum of their digits.

Extensions

a(16)-a(29) from Donovan Johnson, May 09 2009

A356349 Primitive Niven numbers: terms of A005349 that are not ten times another term of A005349.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 18, 21, 24, 27, 36, 42, 45, 48, 54, 63, 72, 81, 84, 102, 108, 110, 111, 112, 114, 117, 126, 132, 133, 135, 140, 144, 150, 152, 153, 156, 162, 171, 190, 192, 195, 198, 201, 204, 207, 209, 216, 220, 222, 224, 225, 228, 230, 234
Offset: 1

Views

Author

Bernard Schott and Rémy Sigrist, Oct 15 2022

Keywords

Comments

A005349(k) belongs to this sequence iff A113315(k) is not a multiple of 10.
This sequence is infinite as it contains A133384 and A199682.
Each Niven number can be uniquely written as a(m)*10^z for some m > 0 and z >= 0.
This sequence contains numbers with k trailing zeros for any k >= 0; for example R(2^k) * 10^k (where R = A002275).

Examples

			190 is a term as 190 is a Niven number and 19 is not a Niven number.
192 is a term as 192 is a Niven number and 192 is not divisible by 10.
		

Crossrefs

Programs

  • PARI
    is(n, base=10) = my (s=sumdigits(n, base)); n%s==0 && (n%base || (n/base)%s)
    
  • Python
    def ok(n):
        sd = sum(map(int, str(n)))
        return sd and not n%sd and (n%10 or (n//10)%sd)
    print([k for k in range(235) if ok(k)]) # Michael S. Branicky, Oct 16 2022

A359960 Smallest Niven (or Harshad) number (A005349) with exactly n distinct prime factors.

Original entry on oeis.org

1, 2, 6, 30, 210, 2310, 30030, 690690, 14804790, 223092870, 8254436190, 200560490130, 8222980095330, 304250263527210, 13082761331670030, 614889782588491410, 32589158477190044730, 1987938667108592728530, 117288381359406970983270, 7858321551080267055879090
Offset: 0

Views

Author

Bernard Schott, Jan 20 2023

Keywords

Comments

a(11) = 200560490130; a(13) = 304250263527210.
a(n) >= A002110(n) = prime(n)#.
Many terms are primorial numbers, see A360011.

Examples

			2310 = 2*3*5*7*11 is the smallest integer with 5 prime factors because it is a primorial number, as 2310 / (2+3+1+0) = 385, 2310 is a Niven number: a(5) = 2310.
		

Crossrefs

Similar: A060319 (Fibonacci), A083002 (oblong), A359961 (Zuckerman).

Programs

  • PARI
    a(n) = my(k=1); while ((k % sumdigits(k)) || (omega(k) != n), k++); k; \\ Michel Marcus, Jan 20 2023
    
  • PARI
    omega_niven(A, B, n) = A=max(A, vecprod(primes(n))); (f(m, p, j) = my(list=List()); forprime(q=p, sqrtnint(B\m, j), my(v=m*q, r=nextprime(q+1)); while(v <= B, if(j==1, if(v>=A && v%sumdigits(v) == 0, listput(list, v)), if(v*r <= B, list=concat(list, f(v, r, j-1)))); v *= q)); list); vecsort(Vec(f(1, 2, n)));
    a(n) = if(n==0, return(1)); my(x=vecprod(primes(n)), y=2*x); while(1, my(v=omega_niven(x, y, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Jan 22 2023

Extensions

a(8)-a(9) from Michel Marcus, Jan 20 2023
a(10)-a(19) from Daniel Suteu, Jan 22 2023

A100433 Bisection of A005349.

Original entry on oeis.org

2, 4, 6, 8, 10, 18, 21, 27, 36, 42, 48, 54, 63, 72, 81, 90, 102, 110, 112, 117, 126, 133, 140, 150, 153, 162, 180, 192, 198, 201, 207, 210, 220, 224, 228, 234, 243, 252, 264, 270, 285, 300, 308, 315, 322, 330, 336, 351, 364, 372, 378, 396, 400, 405, 408, 414
Offset: 1

Views

Author

N. J. A. Sloane, Nov 20 2004

Keywords

Crossrefs

Cf. A005349.

Programs

  • Magma
    A005349:=[n: n in [1..10000] | n mod &+Intseq(n) eq 0];
    A100433:= func< n | A005349[2*n] >;
    [A100433(n): n in [1..150]]; // G. C. Greubel, Apr 09 2023
    
  • Maple
    s:=proc(n) local N:N:=convert(n,base,10):sum(N[j],j=1..nops(N)) end:p:=proc(n) if floor(n/s(n))=n/s(n) then n else fi end: A:=[seq(p(n),n=1..440)]: seq(A[2*j],j=1..58); # Emeric Deutsch, Dec 16 2004
  • Mathematica
    Select[Range[1000], Divisible[#, Total[IntegerDigits[#]]] &][[2;; ;; 2]] (* G. C. Greubel, Apr 09 2023 *)
  • SageMath
    A005349=[n for n in (1..10^4) if sum(n.digits(base=10)).divides(n)]
    def A100433(n): return A005349[2*n-1]
    [A100433(n) for n in range(1,151)] # G. C. Greubel, Apr 09 2023

Formula

a(n) = A005349(2*n). - G. C. Greubel, Apr 09 2023

Extensions

More terms from Emeric Deutsch, Dec 16 2004
Showing 1-10 of 317 results. Next