|
| |
|
|
A154701
|
|
3 consecutive Harshad numbers: for each n in this series n, n+1 and n+2 are Harshad numbers.
|
|
0
| |
|
|
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; internal format)
|
|
|
|
OFFSET
| 1,2
|
|
|
COMMENTS
| Harshad numbers are also known as Niven numbers.
|
|
|
LINKS
| Wikipedia, Harshad number
|
|
|
PROG
| (C) #include <stdio.h>
#include <conio.h>
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;
}
|
|
|
CROSSREFS
| A subset of A005349
Sequence in context: A098755 A028430 A171717 * 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
|
| |
|
|