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!)
A334403 Harshad numbers with sum of digits equal to 18. 1

%I #36 Mar 27 2023 03:38:07

%S 198,288,378,396,468,486,558,576,594,648,666,684,738,756,774,792,828,

%T 846,864,882,918,936,954,972,990,1098,1188,1278,1296,1368,1386,1458,

%U 1476,1494,1548,1566,1584,1638,1656,1674,1692,1728,1746,1764,1782,1818,1836,1854

%N Harshad numbers with sum of digits equal to 18.

%C Even numbers with sum of digits equal to 18 are Harshad numbers (A005349).

%C If k is a term, then so is 10*k. - _Robert Israel_, Mar 26 2023

%H Robert Israel, <a href="/A334403/b334403.txt">Table of n, a(n) for n = 1..10000</a>

%e 198/18 = 11.

%p filter:= n -> convert(convert(n,base,10),`+`) = 18:

%p select(filter, [seq(i,i=18...4000, 18)]); # _Robert Israel_, Mar 26 2023

%t Select[18 * Range[100], Plus @@ IntegerDigits[#] == 18 &] (* _Amiram Eldar_, Sep 08 2020 *)

%o (PARI) isok(m) = my(s=sumdigits(m)); (s==18) && !(m%s); \\ _Michel Marcus_, Sep 08 2020

%o (PARI) first(n) = {my(res = vector(n), t = 0); forstep(i = 18, oo, 18, if(vecsum(digits(i)) == 18, t++; res[t] = i; if(t >= n, return(res) ) ) ) } \\ _David A. Corneth_, Sep 08 2020

%Y Intersection of A005349 and A235228.

%Y Subsequence of A008600.

%Y Cf. A002998.

%K nonn,easy,base

%O 1,1

%A _Davide Rotondo_, Sep 08 2020

%E More terms from _Michel Marcus_, Sep 08 2020

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 April 23 19:56 EDT 2024. Contains 371916 sequences. (Running on oeis4.)