A339012 Written in factorial base, n ends in a(n) consecutive non-0 digits.
0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0, 3, 0, 1, 0, 3, 0, 3, 0, 1, 0, 3, 0, 3, 0, 1, 0, 2, 0, 2, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 2, 0, 2, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 2, 0, 2, 0, 1, 0, 4, 0, 4, 0, 1, 0
Offset: 0
Examples
n = 10571 written in factorial base is 2,0,4,0,1,2,1. It ends in 3 consecutive nonzero digits (1,2,1) so a(10571) = 3. Remainder 10571 mod (3+2)! = 11 is in A227157 row 3.
Links
- Kevin Ryde, Table of n, a(n) for n = 0..10080
Crossrefs
Programs
-
Mathematica
a[n_] := Module[{k = n, m = 2, r}, While[{k, r} = QuotientRemainder[k, m]; r != 0, m++]; m - 2]; Array[a, 30, 0] (* Amiram Eldar, Feb 15 2021 after Kevin Ryde's PARI code *)
-
PARI
a(n) = my(b=2,r); while([n,r]=divrem(n,b);r!=0, b++); b-2;
Comments