login
Odd Niven (or Harshad) numbers: odd numbers that are divisible by the sum of their digits.
2

%I #25 Jul 16 2021 12:38:57

%S 1,3,5,7,9,21,27,45,63,81,111,117,133,135,153,171,195,201,207,209,225,

%T 243,247,261,285,315,333,351,375,399,405,407,423,441,465,481,511,513,

%U 531,555,603,605,621,629,645,711,715,735,777,801,803,825,915,935,999

%N Odd Niven (or Harshad) numbers: odd numbers that are divisible by the sum of their digits.

%D David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, p. 171.

%H Amiram Eldar, <a href="/A101813/b101813.txt">Table of n, a(n) for n = 1..10000</a>

%H Richard K. Guy, <a href="http://www.jstor.org/stable/2691503">The Second Strong Law of Small Numbers</a>, Math. Mag, Vol. 63, No. 1 (1990), pp. 3-20.

%e 629 is a term of the sequence because it is odd and divisible by 17 (= 6+2+9).

%p 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(2*n-1),n=1..530);

%t Select[Range[1,999,2],Divisible[#,Total[IntegerDigits[#]]]&] (* _Harvey P. Dale_, Aug 22 2011 *)

%o (PARI) isok(n) = (n%2) && !(n % sumdigits(n)); \\ _Michel Marcus_, Sep 19 2017

%Y Cf. A005349, A101814.

%K nonn,base

%O 1,2

%A _Emeric Deutsch_, Dec 16 2004

%E Edited by _Charles R Greathouse IV_, Aug 03 2010