OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
The three consecutive Harshad numbers starting at 8 (8, 9, 10) are in arithmetic progression.
The same is true of the three consecutive Harshad numbers starting at 21 (21, 24, 27).
MATHEMATICA
Select[Partition[Select[Range[2000], Divisible[#, DigitSum[#]] &], 3, 1], Equal @@ Differences[#] &][[;; , 1]] (* Amiram Eldar, Mar 17 2024 *)
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
h1, h2, h3 = 1, 2, 3
while True:
if h3 - h2 == h2 - h1: yield h1
h1, h2, h3 = h2, h3, next(k for k in count(h3+1) if k%sum(map(int, str(k))) == 0)
print(list(islice(agen(), 52))) # Michael S. Branicky, Mar 16 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
John Bibby, Mar 16 2024
STATUS
approved