A227911 Number of remainders occurring only once when dividing n by 1,2,...n.
1, 0, 1, 1, 1, 2, 2, 2, 3, 2, 2, 4, 4, 4, 5, 4, 4, 5, 5, 6, 7, 6, 6, 7, 7, 6, 7, 7, 7, 9, 9, 9, 10, 9, 9, 10, 10, 10, 11, 10, 10, 12, 12, 13, 14, 13, 13, 14, 14, 13, 14, 14, 14, 15, 15, 15, 16, 15, 15, 17, 17, 17, 18, 17, 17, 18, 18, 19, 20, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 22, 22, 24, 24, 23
Offset: 1
Keywords
Examples
9 divided by 1,2...9 gives the remainders 0,1,0,1,4,3,2,1,0 of which 2,3,4 occur only once, so a(9)=3.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Table[Count[Tally[Mod[n,Range[n]]],?(#[[2]]==1&)],{n,90}] (* _Harvey P. Dale, Aug 17 2023 *)
-
PARI
a(n)=v=vector(n+1);for(d=1,n,t=(n%d)+1;v[t]=v[t]+1);sum(i=1,n,v[i]==1)
Comments