%I A136709
%S A136709 1,1,1,1,0,1,1,1,1,1,4,2,2,2,1,9,2,2,2,2,13,6,3,3,2,13,11,3,3,3,14,14,
8,
%T A136709 4,3,14,14,13,4,4,15,15,15,10,4,15,15,15,15,5,16,16,16,16,5,16,16,16,16,
%U A136709 6,17,17,17,17,6,17,17,17,17,7,18,18,18,18,7,18,18,18,18,8,19,19,19,19
%N A136709 At step n the sequence lists the number of occurences of digit (n mod
k), with k>0, in all the numbers from 1 to n. Case k=5.
%e A136709 For n=11 we have 4 because the digit (11 mod 5)=1 is present 4 times:
1, 10, 11.
%e A136709 For n=22 we have 6 because the digit (22 mod 5)=2 is present 6 times:
2, 12, 20, 21, 22.
%p A136709 P:=proc(n,m) local a,b,c,d,i,v; v:=array(1..m); for i from 1 to m-1 do
v[i]:=1; print(1); od; if m=10 then v[m]:=1; print(1); else v[m]:=0;
print(0); fi; for i from m+1 by 1 to n do a:=(i mod m); for b from
i-m+1 by 1 to i do d:=b; while d>0 do c:=d-(trunc(d/10)*10); d:=trunc(d/
10); if c=a then if a=0 then v[m]:=v[m]+1; else v[a]:=v[a]+1; fi;
fi; od; od; if a=0 then print(v[m]); else print(v[a]); fi; od; end:
P(101,5);
%Y A136709 Cf. A136706, A136707, A136708, A136710, A136711, A136712, A136713, A136714.
%Y A136709 Sequence in context: A088570 A102888 A071558 this_sequence A137239 A136714
A010314
%Y A136709 Adjacent sequences: A136706 A136707 A136708 this_sequence A136710 A136711
A136712
%K A136709 easy,nonn
%O A136709 0,11
%A A136709 Paolo P. Lava & Giorgio Balzarotti (ppl(AT)spl.at), Jan 18 2008
|