Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A154701
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A154701 3 consecutive Harshad numbers: for each n in this series n, n+1 and n+2 are Harshad numbers. +0
1
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; listen)
OFFSET

1,2

COMMENT

Harshad numbers are also known as Niven numbers.

LINKS

Wikipedia, Harshad number

PROGRAM

(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;

}

(End)

CROSSREFS

A subset of A005349

Sequence in context: A109752 A098755 A028430 this_sequence A004870 A037336 A037443

Adjacent sequences: A154698 A154699 A154700 this_sequence A154702 A154703 A154704

KEYWORD

nonn

AUTHOR

Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 14 2009, Jan 15 2009

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 29 12:46 EST 2009. Contains 167659 sequences.


AT&T Labs Research