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

A066579 Erroneous version of A113315.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 11 2014

Keywords

A005349 Niven (or Harshad, or harshad) numbers: numbers that are divisible by the sum of their digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100, 102, 108, 110, 111, 112, 114, 117, 120, 126, 132, 133, 135, 140, 144, 150, 152, 153, 156, 162, 171, 180, 190, 192, 195, 198, 200, 201, 204
Offset: 1

Views

Author

Keywords

Comments

Both spellings, "Harshad" or "harshad", are in use. It is a Sanskrit word, and in Sanskrit there is no distinction between upper- and lower-case letters. - N. J. A. Sloane, Jan 04 2022
z-Niven numbers are numbers n which are divisible by (A*s(n) + B) where A, B are integers and s(n) is sum of digits of n. Niven numbers have A = 1, B = 0. - Ctibor O. Zizka, Feb 23 2008
A070635(a(n)) = 0. A038186 is a subsequence. - Reinhard Zumkeller, Mar 10 2008
A049445 is a subsequence of this sequence. - Ctibor O. Zizka, Sep 06 2010
Complement of A065877; A188641(a(n)) = 1; A070635(a(n)) = 0. - Reinhard Zumkeller, Apr 07 2011
A001101, the Moran numbers, are a subsequence. - Reinhard Zumkeller, Jun 16 2011
A140866 gives the number of terms <= 10^k. - Robert G. Wilson v, Oct 16 2012
The asymptotic density of this sequence is 0 (Cooper and Kennedy, 1984). - Amiram Eldar, Jul 10 2020
From Amiram Eldar, Oct 02 2023: (Start)
Named "Harshad numbers" by the Indian recreational mathematician Dattatreya Ramchandra Kaprekar (1905-1986) in 1955. The meaning of the word is "giving joy" in Sanskrit.
Named "Niven numbers" by Kennedy et al. (1980) after the Canadian-American mathematician Ivan Morton Niven (1915-1999). During a lecture given at the 5th Annual Miami University Conference on Number Theory in 1977, Niven mentioned a question of finding a number that equals twice the sum of its digits, which appeared in the children's pages of a newspaper. (End)

Examples

			195 is a term of the sequence because it is divisible by 15 (= 1 + 9 + 5).
		

References

  • Paul Dahlenberg and T. Edgar, Consecutive factorial base Niven numbers, Fib. Q., 56:2 (2018), 163-166.
  • D. R. Kaprekar, Multidigital Numbers, Scripta Math., Vol. 21 (1955), p. 27.
  • Robert E. Kennedy and Curtis N. Cooper, On the natural density of the Niven numbers, Abstract 816-11-219, Abstracts Amer. Math. Soc., 6 (1985), 17.
  • Robert E. Kennedy, Terry A. Goodman, and Clarence H. Best, Mathematical Discovery and Niven Numbers, The MATYC Journal, Vol. 14, No. 1 (1980), pp. 21-25.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 381.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 171.

Crossrefs

Cf. A001102 (a subsequence).
Cf. A118363 (for factorial-base analog).
Cf. A330927, A154701, A141769, A330928, A330929, A330930 (start of runs of 2, 3, ..., 7 consecutive Niven numbers).

Programs

  • GAP
    Filtered([1..230],n-> n mod List(List([1..n],ListOfDigits),Sum)[n]=0); # Muniru A Asiru
  • Haskell
    a005349 n = a005349_list !! (n-1)
    a005349_list = filter ((== 0) . a070635) [1..]
    -- Reinhard Zumkeller, Aug 17 2011, Apr 07 2011
    
  • Magma
    [n: n in [1..250] | n mod &+Intseq(n) eq 0];  // Bruno Berselli, May 28 2011
    
  • Magma
    [n: n in [1..250] | IsIntegral(n/&+Intseq(n))];  // Bruno Berselli, Feb 09 2016
    
  • 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: seq(p(n),n=1..210); # Emeric Deutsch
  • Mathematica
    harshadQ[n_] := Mod[n, Plus @@ IntegerDigits@ n] == 0; Select[ Range[1000], harshadQ] (* Alonso del Arte, Aug 04 2004 and modified by Robert G. Wilson v, Oct 16 2012 *)
    Select[Range[300],Divisible[#,Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Sep 07 2015 *)
  • PARI
    is(n)=n%sumdigits(n)==0 \\ Charles R Greathouse IV, Oct 16 2012
    
  • Python
    A005349 = [n for n in range(1,10**6) if not n % sum([int(d) for d in str(n)])] # Chai Wah Wu, Aug 22 2014
    
  • Sage
    [n for n in (1..10^4) if sum(n.digits(base=10)).divides(n)] # Freddy Barrera, Jul 27 2018
    

A334375 a(n) equals the n-th Moran number (A001101) divided by its sum of digits.

Original entry on oeis.org

2, 7, 3, 7, 5, 7, 7, 37, 19, 13, 19, 19, 17, 13, 19, 19, 13, 11, 67, 23, 19, 37, 19, 19, 29, 19, 19, 37, 37, 31, 19, 67, 37, 47, 37, 31, 37, 73, 43, 37, 59, 37, 31, 37, 67, 37, 43, 37, 79, 73, 61, 41, 43, 37, 89, 73, 67, 47, 37, 61, 53, 37, 337, 127, 113, 109
Offset: 1

Views

Author

Rémy Sigrist, Apr 25 2020

Keywords

Examples

			For n = 42:
- A001101(42) = 555,
- A007953(555) = 15,
- hence a(42) = 555/15 = 37.
		

Crossrefs

Programs

  • PARI
    for (n=1, 1090, if (n%(s=sumdigits(n))==0 && isprime(n/s), print1 (n/s", ")))

Formula

a(n) = A001101(n) / A007953(A001101(n)).

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

A066355 A055471(n)/(product of nonzero digits of A055471(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 6, 3, 10, 3, 10, 2, 10, 10, 10, 10, 10, 10, 100, 101, 51, 26, 21, 110, 111, 56, 23, 60, 8, 22, 9, 35, 9, 30, 5, 100, 13, 105, 53, 18, 55, 14, 30, 25, 100, 17, 52, 21, 20, 4, 100, 18, 15, 100, 102, 52, 27, 22, 100, 51, 13, 35, 8, 100, 7, 100
Offset: 1

Views

Author

Amarnath Murthy, Dec 20 2001

Keywords

Examples

			15 is the 13th term of A055471, hence a(13)=15/(1*5) =3.
		

Crossrefs

Programs

  • Mathematica
    pd[n_] := Times @@ Select[IntegerDigits[n], # > 0 &];
    Select[Table[n/pd[n], {n, 1000}], IntegerQ] (* Ray Chandler, Mar 11 2014 *)

Extensions

Corrected and extended by Ray Chandler, Mar 11 2014

A325454 a(n) is the digit sum of the n-th Niven number (or Harshad number).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 3, 9, 2, 3, 6, 9, 3, 9, 4, 6, 9, 12, 5, 9, 6, 9, 7, 9, 8, 9, 12, 9, 1, 3, 9, 2, 3, 4, 6, 9, 3, 9, 6, 7, 9, 5, 9, 6, 8, 9, 12, 9, 9, 9, 10, 12, 15, 18, 2, 3, 6, 9, 11, 3, 9, 4, 6, 8, 9, 12, 5, 9, 6, 9, 13, 9, 9, 12, 14, 9, 10, 15
Offset: 1

Views

Author

Felix Fröhlich, Sep 06 2019

Keywords

Crossrefs

Programs

  • PARI
    is_a005349(n) = n%sumdigits(n)==0
    terms(n) = my(i=0); for(k=1, oo, if(i>=n, break); if(is_a005349(k), print1(sumdigits(k), ", "); i++))
    terms(80) \\ Print initial 80 terms

Formula

a(n) = A005349(n)/A113315(n).
a(n) = A007953(A005349(n)).

A386248 a(n) is the unique integer k such that A161792(n) = k^A000120(A161792(n)).

Original entry on oeis.org

1, 2, 4, 8, 3, 16, 32, 6, 64, 128, 12, 256, 512, 24, 3, 1024, 2048, 48, 4096, 8192, 96, 16384, 32768, 192, 6, 65536, 131072, 384, 262144, 524288, 768, 1048576, 2097152, 1536, 12, 4194304, 3, 8388608, 3072, 3, 16777216, 33554432, 6144, 67108864, 134217728
Offset: 1

Views

Author

Rémy Sigrist, Jul 16 2025

Keywords

Examples

			For n = 11: A161792(11) = 144 = 12^2 = 12^A000120(144), so a(11) = 12.
		

Crossrefs

Programs

  • PARI
    { for (n = 1, 2^27, if (ispower(n, hammingweight(n), &r), print1 (r", "););); }

A260348 Numbers n such that n is divisible by (10^k - digitsum(n)), where k equals the number of digits of digitsum(n).

Original entry on oeis.org

5, 8, 9, 18, 21, 24, 26, 27, 36, 44, 45, 50, 54, 60, 62, 63, 72, 80, 81, 86, 90, 108, 116, 117, 126, 132, 134, 135, 140, 144, 152, 153, 162, 170, 171, 180, 200, 204, 206, 207, 210, 216, 224, 225, 230, 234, 240, 242, 243, 252, 260, 261, 264, 270, 306, 312, 314
Offset: 1

Views

Author

Pieter Post, Jul 23 2015

Keywords

Comments

This sequence is infinite because all numbers with a digitsum equal to 9 are part of this sequence.

Examples

			a(1) = 5, because 5 divided by (10 - 5) equals 1.
a(7) = 26, because digitsum(26) = 8 and 26 divided by (10 - 8) equals 13.
a(20) = 86, the first member of this sequence where digitsum(n) >= 10. Digitsum(86) = 14, so k = 10^2 - 14 = 86, so 86 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{d = Total@ IntegerDigits@ n, k}, k = IntegerLength@ d;
      Divisible[n, 10^k - d]]; Select[Range@ 314, fQ] (* or *)
    Select[Range@ 314, Divisible[#, (10^(Floor[Log[10, Total@ IntegerDigits@ #]] + 1) - Total@ IntegerDigits@ #)] &] (* Michael De Vlieger, Aug 05 2015 *)
  • PARI
    isok(n)=my(sd = sumdigits(n), nsd = #digits(sd)); n % (10^nsd - sd) == 0; \\ Michel Marcus, Aug 05 2015
  • Python
    def sod(n,m):
        kk = 0
        while n > 0:
            kk= kk+(n%m)
            n =int(n//m)
        return kk
    for c in range (1, 10**6):
        k=len(str(sod(c,10)))
        kl=10**k-sod(c,10)
        if c%kl==0:
            print (c)
    

A334417 a(n) is the palindrome equal to A334416(n) divided by its sum of digits.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 2, 7, 4, 3, 4, 7, 5, 4, 6, 7, 8, 9, 7, 55, 22, 11, 55, 22, 55, 22, 55, 55, 33, 55, 55, 55, 55, 44, 55, 55, 55, 55, 505, 88, 66, 202, 262, 77, 121, 88, 99, 181, 151, 121, 101, 88, 505, 424, 181, 121, 151, 181, 131, 343, 202, 181, 141
Offset: 1

Views

Author

Bernard Schott, Apr 29 2020

Keywords

Examples

			A334416(10) = 12 whose sum of digits is 3; 12/3 = 4, so a(10) = 4.
		

Crossrefs

Cf. A334375 (similar for primes).

Programs

  • Mathematica
    Select[#/Plus @@ IntegerDigits[#] & /@ Range[3000], PalindromeQ] (* Amiram Eldar, Apr 29 2020 *)
  • PARI
    isok(m) = iferr(my(d=digits(m/sumdigits(m))); d==Vecrev(d), E, 0);
    apply(x->x/sumdigits(x), select(x->isok(x), [1..3000])) \\ Michel Marcus, Apr 29 2020

Formula

a(n) = A334416(n) / A007953(A334416(n)).
Showing 1-10 of 11 results. Next