OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..2000 (terms 1..250 from Reinhard Zumkeller)
EXAMPLE
2036 is modest because Mod[2036, 36] = 20. 2037 is modest because Mod[2037, 037] = 2. Hence 2036 is this pair's modest twin representative.
MATHEMATICA
mdstQ[n_, d_]:=Module[{c}, c=(FromDigits/@TakeDrop[IntegerDigits[n], d]); Mod[n, c[[2]]/.(0->1)]==c[[1]]]; SequencePosition[Table[ If[ Total[ Boole[ Table[ mdstQ[n, d], {d, IntegerLength[n]-1}]]]>0, 1, 0], {n, 201000}], {1, 1}][[;; , 1]] (* Harvey P. Dale, Nov 22 2025 *)
PROG
(Haskell)
import Data.List (elemIndices)
a055018 n = a055018_list !! (n-1)
a055018_list = map (a054986 . (+ 1)) $ elemIndices 1 $
zipWith (-) (tail a054986_list) a054986_list
-- Reinhard Zumkeller, Mar 26 2012
(Python)
from itertools import count, islice
def modest(n):
pow10 = 1
while (t:= divmod(n, pow10))[0]:
if t[1] and n%t[1] == t[0]: return True
pow10 *= 10
return False
def agen(start=1): # generator of terms >= start
modestk = modest(start-1)
for k in count(start):
modestk1, modestk = modestk, modest(k)
if modestk and modestk1: yield k-1
print(list(islice(agen(), 38))) # Michael S. Branicky, Dec 08 2025
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Hans Havermann, May 31 2000
STATUS
approved
