login
Number of 7's when n is written in base b for 2<=b<=n+1.
11

%I #14 Aug 21 2024 05:40:21

%S 0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,2,2,

%T 2,1,3,1,3,2,2,1,4,1,2,2,4,1,3,1,3,3,2,1,5,2,4,3,4,2,5,3,6,3,3,2,7,2,

%U 3,5,6,3,5,2,4,3,6,3,9,2,3,4,4,4,6,3,8,4,3,2

%N Number of 7's when n is written in base b for 2<=b<=n+1.

%H Robert Israel, <a href="/A033107/b033107.txt">Table of n, a(n) for n = 1..10000</a>

%p f:= proc(n) local b;`+`(seq(numboccur(7,convert(n,base,b)),b=8..n+1)) end proc:

%p map(f, [$1..100]); # _Robert Israel_, Aug 20 2024

%t f[n_] := Count[Flatten@ Table[ IntegerDigits[n, b], {b, 2, n + 1}], 7]; Array[f, 90] (* _Robert G. Wilson v_, Nov 14 2012 *)

%Y Cf. A033093, A033095, A033097, A033099, A033101, A033103, A033105, A033108, A033109, A033111.

%K nonn,base,look

%O 1,23

%A _Clark Kimberling_