login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A005349 Niven (or Harshad, or harshad) numbers: numbers that are divisible by the sum of their digits.
(Formerly M0481)
306
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
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)
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.
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..11872 (all a(n) <= 100000)
Bob Albrecht, Don Albers, and Jim Conlan, Problem #22 Two-digit Niven numbers, Programming Problems, Recreational Computing Magazine, Vol. 9, No. 1, Issue 46 (1980), p. 59.
Curtis N. Cooper and Robert E. Kennedy, On an asymptotic formula for the Niven numbers, International Journal of Mathematics and Mathematical Sciences, Vol. 8, No. 3 (1985), pp. 537-543.
Curtis N. Cooper and Robert E. Kennedy, Chebyshev's inequality and natural density, Amer. Math. Monthly 96 (1989), no. 2, 118-124.
Paul Dalenberg and Tom Edgar, Consecutive factorial base Niven numbers, Fibonacci Quart. (2018) Vol. 56, No. 2, 163-166.
Jean-Marie De Koninck and Nicolas Doyon, Large and Small Gaps Between Consecutive Niven Numbers, J. Integer Seqs., Vol. 6, 2003, Article 03.2.5.
Nicolas Doyon, Les fascinants nombres de Niven, Thèse de la faculté des sciences et de génie de l'université Laval, Québec,‎ Novembre 2006 (in French).
Richard K. Guy, The Second Strong Law of Small Numbers, Math. Mag, 63 (1990), no. 1, 3-20.
Richard K. Guy, The Second Strong Law of Small Numbers, Math. Mag, 63 (1990), no. 1, 3-20. [Annotated scanned copy]
Robert E. Kennedy, Digital sums, Niven numbers, and natural density, Crux Mathematicorum, Vol. 8 (1982), pp. 131-135.
Robert E. Kennedy and Curtis N. Cooper, On the natural density of the Niven numbers, The College Mathematics Journal, Vol. 15, No. 4 (Sep., 1984), pp. 309-312.
Terry Trotter, Niven Numbers for Fun and Profit. [archived page]
Gérard Villemin, Nombres de Harshad (French).
Elaine E. Visitacion, Renalyn T. Boado, Mary Ann V. Doria, and Eduard M. Albay, On Harshad Number, DMMMSU-CAS Science Monitor (2016-2017) Vol. 15 No. 2, 134-138. [archived]
Eric Weisstein's World of Mathematics, Digit and Harshad Numbers.
Wikipedia, Harshad number.
EXAMPLE
195 is a term of the sequence because it is divisible by 15 (= 1 + 9 + 5).
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 *)
PROG
(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
(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
(GAP) Filtered([1..230], n-> n mod List(List([1..n], ListOfDigits), Sum)[n]=0); # Muniru A Asiru
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).
Sequence in context: A064807 A235591 A007603 * A234474 A285829 A225780
KEYWORD
nonn,base,nice,easy,changed
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 06:19 EDT 2024. Contains 370953 sequences. (Running on oeis4.)