The OEIS is supported by the many generous donors to the OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A154701 Numbers k such that k, k + 1 and k + 2 are 3 consecutive Harshad numbers. 27
 1, 2, 3, 4, 5, 6, 7, 8, 110, 510, 511, 1010, 1014, 1015, 2022, 2023, 2464, 3030, 3031, 4912, 5054, 5831, 7360, 8203, 9854, 10010, 10094, 10307, 10308, 11645, 12102, 12103, 12255, 12256, 13110, 13111, 13116, 13880, 14704, 15134, 17152, 17575, 18238, 19600, 19682 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS Harshad numbers are also known as Niven numbers. Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite. - Amiram Eldar, Jan 03 2020 REFERENCES Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110. LINKS Robert Israel, Table of n, a(n) for n = 1..10000 Curtis Cooper and Robert E. Kennedy, On consecutive Niven numbers, Fibonacci Quarterly, Vol. 21, No. 2 (1993), pp. 146-151. Helen G. Grundman, Sequences of consecutive Niven numbers, Fibonacci Quarterly, Vol. 32, No. 2 (1994), pp. 174-175. Wikipedia, Harshad number Brad Wilson Construction of 2n consecutive n-Niven numbers, Fibonacci Quarterly, Vol. 35, No. 2 (1997), pp. 122-128. EXAMPLE 110 is a term since 110 is divisible by 1 + 1 + 0 = 2, 111 is divisible by 1 + 1 + 1 = 3, and 112 is divisible by 1 + 1 + 2 = 4. MAPLE Res:= NULL: count:= 0: state:= 1: L:= : for n from 2 while count < 100 do   L:=L+1;   for k from 1 while L[k]=10 do L[k]:= 0;     if k = nops(L) then L:= [0\$nops(L), 1]; break     else L[k+1]:= L[k+1]+1 fi   od:   s:= convert(L, `+`);   if n mod s = 0 then      state:= min(state+1, 3);      if state = 3 then count:= count+1; Res:= Res, n-2; fi   else state:= 0   fi od: Res; # Robert Israel, Feb 01 2019 MATHEMATICA nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; niv = nivenQ /@ Range; seq = {}; Do[niv = Join[Rest[niv], {nivenQ[k]}]; If[And @@ niv, AppendTo[seq, k - 2]], {k, 3, 2*10^4}]; seq (* Amiram Eldar, Jan 03 2020 *) PROG (C) #include #include int is_harshad(int n){   int i, j, count=0;   i=n;   while(i>0){     count=count+i%10;     i=i/10;   }   return n%count==0?1:0; } main(){   int k;   clrscr();   for(k=1; k<=30000; k++)     if(is_harshad(k)&&is_harshad(k+1)&&is_harshad(k+2))       printf("%d, ", k);   getch();   return 0; } (MAGMA) f:=func; a:=[]; for k in [1..20000] do  if forall{m:m in [0..2]|f(k+m)} then Append(~a, k); end if; end for; a; // Marius A. Burtea, Jan 03 2020 CROSSREFS A subset of A005349. Cf. A060159, A141769, A328210, A328214, A330927, A330928, A330929, A330930, A330932. Sequence in context: A290148 A171717 A303369 * A004870 A037336 A037443 Adjacent sequences:  A154698 A154699 A154700 * A154702 A154703 A154704 KEYWORD nonn,base AUTHOR Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 14 2009, Jan 15 2009 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.

Last modified July 4 02:09 EDT 2022. Contains 355063 sequences. (Running on oeis4.)