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!)
A136711 At step n the sequence lists the number of occurrences of digit (n mod k), with k>0, in all the numbers from 1 to n. Case k=7. 9

%I #12 Feb 22 2020 20:57:36

%S 1,1,1,1,1,1,0,1,1,1,1,1,1,1,8,2,2,2,2,2,2,13,7,3,3,3,3,2,13,13,5,3,3,

%T 3,3,14,14,13,4,4,4,4,15,15,15,12,5,5,4,15,15,15,15,10,5,5,16,16,16,

%U 16,16,9,6,17,17,17,17,17,17,7,18,18,18,18,18,18,7,18,18,18,18,18,18,8,19,19

%N At step n the sequence lists the number of occurrences of digit (n mod k), with k>0, in all the numbers from 1 to n. Case k=7.

%H Harvey P. Dale, <a href="/A136711/b136711.txt">Table of n, a(n) for n = 0..1000</a>

%e For n=15 we have 8 because the digit (15 mod 7)=1 is present 8 times: 1, 10, 11, 12, 13, 14, 15.

%e For n=20 we have 2 because the digit (20 mod 7)=6 is present twice: 6, 16.

%p 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,7);

%t Table[Total[DigitCount[Range[n],10,Mod[n,7]]],{n,90}] (* _Harvey P. Dale_, Jun 04 2017 *)

%Y Cf. A136706, A136707, A136708, A136709, A136710, A136712, A136713, A136714.

%K easy,base,nonn

%O 0,15

%A _Paolo P. Lava_ and _Giorgio Balzarotti_, Jan 18 2008

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 16 10:08 EDT 2024. Contains 371698 sequences. (Running on oeis4.)