A269982 Factorial fractility of n.
1, 1, 2, 2, 1, 1, 2, 2, 3, 1, 2, 1, 2, 3, 2, 3, 2, 1, 4, 3, 2, 2, 2, 3, 2, 2, 4, 1, 3, 1, 2, 2, 4, 4, 3, 2, 2, 2, 4, 3, 3, 1, 3, 4, 4, 4, 2, 2, 4, 4, 3, 2, 2, 3, 4, 2, 2, 1, 4, 2, 3, 4, 2, 4, 2, 1, 5, 4, 5, 5, 3, 1, 3, 4, 3, 4, 2, 1, 4, 2, 4, 2, 4, 5, 2, 2
Offset: 2
Keywords
Examples
NI(1/10) = (3, 2, 1, 1, 1, 2, 3, 2, 1, 1, 1, 2, 3, 2, 1, 1, 1, ...) NI(2/10) = (2, 3, 2, 1, 1, 1, 2, 3, 2, 1, 1, 1, 2, 3, 2, 1, 1, ...) NI(3/10) = (2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, ...) NI(4/10) = (2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, ...) NI(5/10) = (2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...) NI(6/10) = (1, 2, 3, 2, 1, 1, 1, 2, 3, 2, 1, 1, 1, 2, 3, 2, 1, ...) NI(7/10) = (1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, ...) NI(8/10) = (1, 1, 2, 3, 2, 1, 1, 1, 2, 3, 2, 1, 1, 1, 2, 3, 2, ...) NI(9/10) = (1, 1, 1, 2, 3, 2, 1, 1, 1, 2, 3, 2, 1, 1, 1, 2, 3, ...), so that there are 3 equivalence classes for n = 10, and the factorial fractility of 10 is 3.
Links
- Robert Price, Table of n, a(n) for n = 2..500
Crossrefs
Programs
-
Mathematica
A269982[n_] := CountDistinct[With[{l = NestWhileList[Rescale[#, {1/(Floor[x] + 1)!, 1/Floor[x]!} /. FindRoot[1/x! == #, {x, 1}]] &, #, UnsameQ, All]}, Min@l[[First@First@Position[l, Last@l] ;;]]] & /@ Range[1/n, 1 - 1/n, 1/n]] (* Davin Park, Nov 19 2016 *)
-
PARI
A269982(n)=#Set(vector(n-1, k, NIFR(k/n))) \\ where: NIFR(x, n, L=1, S=[], c=0)={for(i=2, oo, n=A084558(L\x); S=setunion(S, [x/L]); x-=L/(n+1)!; L/=(n+1)!\n; setsearch(S, x/L)&& if(c, break, c=!S=[])); S[1]} \\ variant of the function NIF() below; returns just a unique representative (smallest x/L occurring within the period) of the equivalence class. NIF(x, n=[], L=1, S=[], c=0)={for(i=2, oo, n=concat(n, A084558(L\x)); c|| S=setunion(S, [x/L]); x-=L/(n[#n]+1)!; L/=(n[#n]-1)!*(n[#n]+1); if(!c, setsearch(S, x/L)&& [c, S]=[i, x/L], x/L==S, c-=i; break)); [n[1..2*c-1], n[c..-1]]} \\ Returns [transition, period] of "factorial" NI(x). (End)
Extensions
Edited by M. F. Hasler, Nov 05 2018
Comments