login
A082792
Smallest multiple of n beginning with 3.
4
3, 30, 3, 32, 30, 30, 35, 32, 36, 30, 33, 36, 39, 308, 30, 32, 34, 36, 38, 300, 315, 308, 322, 312, 300, 312, 324, 308, 319, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 320, 328, 336, 301, 308, 315, 322, 329, 336, 343, 300, 306, 312, 318, 324, 330, 336, 342, 348, 354
OFFSET
1,1
COMMENTS
a(n) is in {n, 2n, 3n, 4n, 5n, 6n, 7n, 8n, 11n, 12n, 13n, 14n, 15n, 21n, 22n, 23n}. - Charles R Greathouse IV, Mar 06 2011
LINKS
MATHEMATICA
f[n_] := Block[{m = n}, While[ First@ IntegerDigits@ m != 3, m += n]; m]; Array[f, 59] (* Robert G. Wilson v, Mar 06 2011 *)
PROG
(PARI) a(n)=forstep(k=n, 23*n, n, if(Vec(Str(k))[1]=="3", return(k))) \\ Charles R Greathouse IV, Mar 06 2011
(Haskell)
a082792 n = until ((== 3) . a000030) (+ n) n
-- Reinhard Zumkeller, Mar 27 2012
(Python)
def a(n):
kn = n
while str(kn)[0] != '3': kn += n
return kn
print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Mar 30 2021
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Apr 20 2003
EXTENSIONS
Corrected and extended by Sean A. Irvine, Mar 06 2011
STATUS
approved