A348467 The number of distinct decimal representations of integers embedded as slices in the decimal representation of n!.
1, 1, 1, 1, 3, 6, 6, 7, 11, 20, 25, 33, 32, 41, 60, 72, 80, 106, 104, 132, 140, 150, 173, 239, 241, 269, 306, 344, 369, 440, 487, 542, 550, 639, 639, 754, 799, 840, 777, 932, 1094, 1032, 1129, 1203, 1376, 1440, 1386, 1681, 1700, 1737, 1700, 1948, 1964, 2099, 2219
Offset: 0
Examples
0: 1 // 1; 1: 1 // 1; 2: 1 // 2; 3: 1 // 6; 4: 3 // 2,4,24; 5: 6 // 0,1,2,12,20,120; 6: 6 // 0,2,7,20,72,720; 7: 7 // 0,4,5,40,50,504,5040; 8: 11 // 0,2,3,4,20,32,40,320,403,4032,40320; 9: 20 // 0,2,3,6,8,28,36,62,80,88,288,362,628,880,2880,3628,6288,36288,62880, 362880.
Programs
-
Mathematica
a[n_] := Length@ DeleteDuplicates[FromDigits /@ Rest@ Subsequences[ IntegerDigits[n!]]]; Array[a, 50, 0] (* Amiram Eldar, Oct 19 2021 *)
-
PARI
f(n) = if (n==0, return (1)); my(d=digits(n), list=List()); for (k=1, #d, for (j=1, #d-k+1, my(dk=vector(j, i, d[k+i-1])); listput(list, fromdigits(dk)););); #Set(list); \\ A120004 a(n) = f(n!); \\ Michel Marcus, Oct 19 2021
-
Python
from math import factorial def A348467(n): s = str(factorial(n)) m = len(s) return len(set(int(s[i:j]) for i in range(m) for j in range(i+1,m+1))) # Chai Wah Wu, Oct 19 2021
Formula
a(n) = A120004(n!). - Michel Marcus, Oct 19 2021