login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078213 Smallest multiple of n beginning and ending in n and with a digit sum that is divisible by n. 1

%I #7 Sep 04 2020 17:02:08

%S 1,2,3,4,5,6,7,8,9,10810,119911,12612,1310413,1411214,15315,162016,

%T 1745917,1818,1968419,207920,2116821,227722,2318423,244824,252925,

%U 269126,272727,283528,2923229,3069930,31275931,3268832,3375933,3457834

%N Smallest multiple of n beginning and ending in n and with a digit sum that is divisible by n.

%t smn[n_]:=Module[{k=1,id=IntegerDigits[n],c},c=k*n;While[Take[ IntegerDigits[ c],IntegerLength[n]]!=id||Take[IntegerDigits[c],-IntegerLength[ n]]!=id||!Divisible[Total[IntegerDigits[k*n]],n],k++;c=k*n];k*n]; Array[smn,35] (* _Harvey P. Dale_, Sep 04 2020 *)

%o (PARI) {for(n=1,34,k=length(Str(n)); s=n; t=s+1; d=k-length(Str(m)); s=s*10^d; t=t*10^d; b=1; while(b>0,q=floor(s/n); while(b>0&&(p=q*n)<t,m=0; z=p; while(z>0,y=divrem(z,10); z=y[1]; m=m+y[2]); if(p>=s&&(p%10^k) == n&&(m%n) == 0,print1(p,","); b=0,q++)); s=10*s; t=10*t))}

%Y Cf. A078214.

%K base,nonn

%O 1,2

%A _Amarnath Murthy_, Nov 22 2002

%E Edited and extended by _Klaus Brockhaus_, Dec 09 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)