OFFSET
0,5
COMMENTS
In other words, a(n+1) is the sum, taken over each distinct d in a(n), of the number of pairs (d,d) counted from different occurrences of d in a(j), 0 <= j <= n.
Every term is the sum of one or more triangular numbers (A000217). If no digit in a(n) has occurred before, a(n+1) = 0 (there are 7 such terms). Some numbers (0,1,3,4,6,10,...) occur multiple times, while others (2,5,8,11,...) never occur.
a(28844) = 2417583609 is the first pandigital term. Similar to A279818.
EXAMPLE
a(1) = 0 because there are no terms prior to a(0)=0;
a(2) = 1 because 0 has occurred just twice, and 0,0 can be counted just once.
To calculate a(39) given that a(38) = 133: c(1) = 14 so (1,1) can be counted 13*14/2=91 times, c(3) = 7 so (3,3) can be counted 6*7/2 = 21 times. Therefore a(39) = 91 + 21 = 112.
MATHEMATICA
nn = 65; d[_] = -1; a[1] = d[0] = 0; Do[c = DigitCount[a[n - 1]]; MapIndexed[AddTo[d[First[#2]], #1] &, c]; a[n] = Total@ Map[# (# + 1)/2 &@ d[#] &, Position[c, _?(# > 0 &)][[All, 1]] ], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Mar 23 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David James Sycamore, Mar 16 2022
STATUS
approved