A155895 Least positive integer such that a(n)! starts with n, both written in base 5.
1, 2, 17, 4, 6, 3, 29, 7, 10, 19, 31, 8, 18, 14, 37, 61, 81, 17, 33, 11, 63, 94, 9, 4, 13, 24, 16, 6, 27, 22, 52, 152, 28, 21, 143, 45, 35, 29, 67, 7, 62, 15, 247, 181, 193, 10, 105, 48, 12, 97, 19, 167, 36, 72, 146, 75, 31, 391, 69, 40, 186, 486, 133, 8, 57, 46, 18, 103, 115
Offset: 1
Examples
a(3) = 17 since 17! is the least factorial to start with digit "3" when written in base 5. a(5) = 6 since 5 = 10[5] (i.e. written in base 5) and 6! = 720 = 625 + 75 + 20 = 10340[5] is the smallest factorial to start with digits "10" when written in base 5.
Programs
-
PARI
A155895(n)={ local( F=1,k=1 ); while( F\1!=n, F*=k++; while( F>=n+1, F/=5)); k}