OFFSET
1,10
COMMENTS
The motivation to consider this sequence came from the proposal A256379 by Anthony Sand.
This sequence can also be read as an irregular triangle (array) in which a(n, k) is the number of appearances of the k-th digit of n in the digits of 1, ... ,n-1 and the first k digits of n. See the example for the head of this array. The row length is A055842(n), n >= 1.
This can also be described as the ordinal transform of A007376. - Franklin T. Adams-Watters, Oct 10 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(10) = 2 because A007376(10) = 1 and that sequence up to n=10 is 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, and 1 appears twice.
a(24) = 10 because A007376(24) = 1 and this is the tenth 1 in A007376 up to, and including, A007376(24).
Read as a tabf array a(n, k) with row length A055842(n) this begins:
n\k 1 2 ...
1: 1
2: 1
3: 1
4: 1
5: 1
6: 1
7: 1
8: 1
9: 1
10: 2 1
11: 3 4
12: 5 2
13: 6 2
14: 7 2
15: 8 2
16: 9 2
17: 10 2
18: 11 2
19: 12 2
20: 3 2
...
MATHEMATICA
lim = 120; s = Flatten[IntegerDigits /@ Range@ lim]; f[n_] := Block[{d = IntegerDigits /@ Take[s, n] // Flatten // FromDigits}, DigitCount[d][[If[ s[[n]] == 0, 10, s[[n]] ]] ] ]; Array[f, lim] (* Michael De Vlieger, Apr 08 2015, after Robert G. Wilson v at A007376 *)
PROG
(Haskell)
a256100 n = a256100_list !! (n-1)
a256100_list = f a007376_list $ take 10 $ repeat 1 where
f (d:ds) counts = y : f ds (xs ++ (y + 1) : ys) where
(xs, y:ys) = splitAt d counts
-- Reinhard Zumkeller, Aug 13 2015
CROSSREFS
KEYWORD
AUTHOR
Wolfdieter Lang, Apr 08 2015
STATUS
approved