login
Smallest multiple of n beginning with 5.
8

%I #18 Dec 05 2013 19:56:13

%S 5,50,51,52,5,54,56,56,54,50,55,504,52,56,510,512,51,54,57,500,504,

%T 506,506,504,50,52,54,56,58,510,527,512,528,510,525,504,518,532,507,

%U 520,533,504,516,528,540,506,517,528,539,50,51,52,53,54

%N Smallest multiple of n beginning with 5.

%C a(n) is in {n, 2n, 3n, 4n, 5n, 6n, 7n, 8n, 9n, 11n, 12n, 13n, 14n, 15n, 16n, 17n, 21n, 22n, 23n, 24n, 25n, 31n, 32n, 33n, 34n, 41n, 42n}. [_Charles R Greathouse IV_, Mar 06 2011]

%H Reinhard Zumkeller, <a href="/A082795/b082795.txt">Table of n, a(n) for n = 1..10000</a>

%t f[n_] := Block[{m = n}, While[ First@ IntegerDigits@ m != 5, m += n]; m]; Array[f, 54] (* _Robert G. Wilson v_ *)

%o (PARI) a(n)=forstep(k=n, 42*n, n, if(Vec(Str(k))[1]=="5", return(k))) \\ _Charles R Greathouse IV_, Mar 06 2011

%o (Haskell)

%o a082795 n = until ((== 5) . a000030) (+ n) n

%o -- _Reinhard Zumkeller_, Mar 27 2012

%Y Cf. A082794, A082796, A082797, A082798.

%Y Cf. A000030.

%K base,easy,nonn

%O 1,1

%A _Amarnath Murthy_, Apr 20 2003

%E Corrected and extended by _Sean A. Irvine_, Mar 06 2011