login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Repdigits which are also Harshad numbers.
0

%I #21 Jan 07 2025 19:07:10

%S 1,2,3,4,5,6,7,8,9,111,222,333,444,555,666,777,888,999,111111111,

%T 222222222,333333333,444444444,555555555,666666666,777777777,

%U 888888888,999999999,111111111111111111111111111,222222222222222222222222222,333333333333333333333333333,444444444444444444444444444

%N Repdigits which are also Harshad numbers.

%e 999 is in the sequence as it is a repdigit (all digits are equal (in base 10)) and 999 is divisible by its sum of digits; 9 + 9 + 9 = 27 is a divisors of 999. - _David A. Corneth_, Oct 20 2024

%t Select[Union[FromDigits/@Flatten[Table[PadRight[{}, i, n], {n, 9}, {i, 27}], 1]],Divisible[#,DigitSum[#]]&] (* _James C. McMahon_, Jan 07 2025 *)

%o (PARI) repd(n) = 10^((n+8)\9)\9*((n-1)%9+1); \\ A010785

%o lista(nn) = select(x->(x%sumdigits(x)==0), vector(nn, k, repd(k))); \\ _Michel Marcus_, Jan 07 2025

%Y Intersection of A005349 and A010785.

%Y Cf. A014950.

%K nonn,base

%O 1,2

%A _John Bibby_, Oct 20 2024

%E More terms from _David A. Corneth_, Oct 20 2024