A080217 a(n) is the number of distinct values taken by binomial(n,j) mod j for j in [1..n].
1, 2, 2, 2, 2, 4, 4, 4, 3, 4, 4, 7, 7, 6, 5, 7, 7, 7, 7, 9, 11, 12, 12, 12, 11, 11, 10, 11, 11, 12, 12, 12, 11, 12, 12, 13, 13, 13, 17, 18, 18, 15, 15, 18, 21, 17, 17, 19, 19, 18, 17, 16, 16, 20, 20, 23, 25, 23, 23, 26, 26, 24, 22, 24, 24, 27, 27, 27, 25, 28, 28, 30, 30, 32, 31, 30
Offset: 1
Keywords
Examples
n=14: {binomial(14,j) mod j, j=1..14} = {0,1,1,1,2,3,2,3,4,1,1,7,1,1} includes six distinct residues (0,1,2,3,4,7) so a(14) = 6.
Links
- Robin Visser, Table of n, a(n) for n = 1..10000 (terms n = 1..1000 from Vincenzo Librandi).
Programs
-
Mathematica
Table[Length[Union[Table[Mod[Binomial[n, j], j], {j, 1, n}]]], {n, 1, 256}]
-
PARI
a(n) = #vecsort(vector(n, j, binomial(n, j) % j), ,8); \\ Michel Marcus, Jul 29 2017
-
Sage
def a(n): return len(set([binomial(n,j)%j for j in range(1, n+1)])) # Robin Visser, Nov 26 2023
Formula
a(n) = Card(Union{j=1..n} binomial(n,j) mod j).