This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
Factorial base representation (A007623) of 1 is "1", shifting it left yields "10", and when we increment all nonzero digits by one, we get "20", which is the factorial base representation of 4 (as 4 = 2*2! + 0*1!), thus a(1) = 4. F.b.r. of 2 is "10", shifting it left yields "100", and "200" is f.b.r. of 12, thus a(2) = 12. F.b.r. of 43 is "1301", shifting it left and incrementing all nonzeros by one yields "24020", which is f.b.r of 340, thus a(43) = 340.
factBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > i!, i++]; m = n; len = i; dList = Table[0, {len}]; Do[currDigit = 0; While[m >= j!, m = m - j!; currDigit++]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; dList]; s = Table[FromDigits[factBaseIntDs[n]], {n, 500}]; {0}~Join~Flatten@ Position[s, x_ /; DigitCount[x][[1]] == 0](* Michael De Vlieger, Apr 27 2015, after Alonso del Arte at A007623 *) Select[Range[0, 444], ! MemberQ[IntegerDigits[#, MixedRadix[Reverse@ Range@ 12]], 1] &] (* Michael De Vlieger, May 30 2016, Version 10.2 *) r = MixedRadix[Reverse@Range[2, 12]]; Table[FromDigits[Map[If[# == 0, 0, # + 1] &, IntegerDigits[n, r]]~Join~{0}, r], {n, 0, 60}] (* Michael De Vlieger, Aug 14 2016, Version 10.2 *)
from sympy import factorial as f def a007623(n, p=2): return n if n0 else '0' for i in x)[::-1] return 0 if n==0 else sum(int(y[i])*f(i + 1) for i in range(len(y))) print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 20 2017
Select[Range@ 101, MemberQ[IntegerDigits[#, MixedRadix[Reverse@ Range@ 12]], 1] &] (* Michael De Vlieger, May 30 2016, Version 10.2 *) r = MixedRadix[Reverse@ Range[2, 12]]; Select[Range@ 101, Min[IntegerDigits[#, r] /. 0 -> Nothing] == 1 &] (* Michael De Vlieger, Aug 14 2016, Version 10.2 *)
def A(n, p=2): return n if n=1]) # Indranil Ghosh, Jun 19 2017
a062119 n = (n - 1) * a000142 n -- Reinhard Zumkeller, Aug 27 2012
G(x):=x^2/(1-x)^2: f[0]:=G(x): for n from 1 to 19 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=1..19); # Zerinvary Lajos, Apr 01 2009
a[n_]:=1*(n+2)!-2*(n+1)!; (* or *) a[n_]:=n!*(n-1); (* Vladimir Joseph Stephan Orlovsky, Dec 05 2008 *) Table[n!(n-1),{n,20}] (* Harvey P. Dale, Aug 29 2021 *)
{ f=1; for (n=1, 100, f*=n; write("b062119.txt", n, " ", f*(n - 1)) ) } \\ Harry J. Smith, Aug 02 2009
a(n) = n!*(n-1); \\ Altug Alkan, May 04 2018
(define (A062119 n) (* (- n 1) (A000142 n))) ;; Antti Karttunen, May 07 2015
The top left {1..9} x {1..18} corner of the array: 1, 2, 6, 24, 120, 720, 5040, 40320, 362880 3, 8, 30, 144, 840, 5760, 45360, 403200, 3991680 4, 12, 48, 240, 1440, 10080, 80640, 725760, 7257600 5, 14, 54, 264, 1560, 10800, 85680, 766080, 7620480 7, 26, 126, 744, 5160, 41040, 367920, 3669120, 40279680 9, 32, 150, 864, 5880, 46080, 408240, 4032000, 43908480 10, 36, 168, 960, 6480, 50400, 443520, 4354560, 47174400 11, 38, 174, 984, 6600, 51120, 448560, 4394880, 47537280 13, 50, 246, 1464, 10200, 81360, 730800, 7297920, 80196480 15, 56, 270, 1584, 10920, 86400, 771120, 7660800, 83825280 16, 60, 288, 1680, 11520, 90720, 806400, 7983360, 87091200 17, 62, 294, 1704, 11640, 91440, 811440, 8023680, 87454080 18, 72, 360, 2160, 15120, 120960, 1088640, 10886400, 119750400 19, 74, 366, 2184, 15240, 121680, 1093680, 10926720, 120113280 20, 78, 384, 2280, 15840, 126000, 1128960, 11249280, 123379200 21, 80, 390, 2304, 15960, 126720, 1134000, 11289600, 123742080 22, 84, 408, 2400, 16560, 131040, 1169280, 11612160, 127008000 23, 86, 414, 2424, 16680, 131760, 1174320, 11652480, 127370880
The top left corner of the array: 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13 4, 12, 16, 22, 48, 52, 60, 64, 66, 70, 76 18, 72, 90, 114, 360, 378, 432, 450, 456, 474, 498 96, 480, 576, 696, 2880, 2976, 3360, 3456, 3480, 3576, 3696 600, 3600, 4200, 4920, 25200, 25800, 28800, 29400, 29520, 30120, 30840 4320, 30240, 34560, 39600, 241920, 246240, 272160, 276480, 277200, 281520, 286560 ...
Factorial base representation (A007623) of 4 is "20", the smallest digit which is not zero is "2", thus a(4) = 2.
a[n_] := Module[{k = n, m = 2, rmin = n, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[0 < r < rmin, rmin = r]; m++]; rmin]; Array[a, 100, 0] (* Amiram Eldar, Jan 23 2024 *)
def A(n, p=2): return n if n
(define (A257679 n) (let loop ((n n) (i 2) (mind 0)) (if (zero? n) mind (let ((d (modulo n i))) (loop (/ (- n d) i) (+ 1 i) (cond ((zero? mind) d) ((zero? d) mind) (else (min d mind)))))))) ;; Alternative implementations based on given recurrences, using memoizing definec-macro: (definec (A257679 n) (if (zero? (A257687 n)) (A099563 n) (min (A099563 n) (A257679 (A257687 n))))) (definec (A257679 n) (cond ((zero? n) n) ((= 1 (A257680 n)) 1) (else (+ 1 (A257679 (A257684 n))))))
Square array A(n,k) [where n=row, k=column] is read by ascending antidiagonals as: A(0,0), A(1,0), A(0,1), A(2,0), A(1,1), A(0,2), A(3,0), A(2,1), A(1,2), A(0,3), ... Array starts: n\k [0 1 2 3 4 5 6 7 8] -------------------------------------------------------------- [0] [1, 0, 0, 0, 0, 0, 0, 0, 0] [1] [1, 1, 2, 6, 24, 120, 720, 5040, 40320] [2] [1, 2, 6, 24, 120, 720, 5040, 40320, 362880] [3] [1, 3, 12, 60, 360, 2520, 20160, 181440, 1814400] [4] [1, 4, 20, 120, 840, 6720, 60480, 604800, 6652800] [5] [1, 5, 30, 210, 1680, 15120, 151200, 1663200, 19958400] [6] [1, 6, 42, 336, 3024, 30240, 332640, 3991680, 51891840] [7] [1, 7, 56, 504, 5040, 55440, 665280, 8648640, 121080960] [8] [1, 8, 72, 720, 7920, 95040, 1235520, 17297280, 259459200] . Seen as a triangle, T(n, k) = Pochhammer(n - k, k), the first few rows are: [0] 1; [1] 1, 0; [2] 1, 1, 0; [3] 1, 2, 2, 0; [4] 1, 3, 6, 6, 0; [5] 1, 4, 12, 24, 24, 0; [6] 1, 5, 20, 60, 120, 120, 0; [7] 1, 6, 30, 120, 360, 720, 720, 0; [8] 1, 7, 42, 210, 840, 2520, 5040, 5040, 0; [9] 1, 8, 56, 336, 1680, 6720, 20160, 40320, 40320, 0.
for n from 0 to 8 do seq(pochhammer(n,k), k=0..8) od;
Table[Pochhammer[n, k], {n, 0, 8}, {k, 0, 8}]
for n in (0..8): print([rising_factorial(n,k) for k in (0..8)])
(define (A265609 n) (A265609bi (A025581 n) (A002262 n))) (define (A265609bi row col) (if (zero? col) 1 (* (+ row col -1) (A265609bi row (- col 1))))) ;; Antti Karttunen, Dec 19 2015
[0,0] cat [n*(n+1)*(n+2)*Factorial(n): n in [0..20]]; // Vincenzo Librandi, Oct 11 2011
spec := [S,{S=Prod(Z,Z,Z,Sequence(Z),Sequence(Z))},labeled]: seq(combstruct[count](spec,size=n), n=0..20); [seq (n*(n+1)*(n+2)*n!,n=0..17)]; # Zerinvary Lajos, Nov 25 2006 a:=n->add((n!),j=1..n-2):seq(a(n), n=0..21); # Zerinvary Lajos, Aug 27 2008 G(x):=x^3/(1-x)^2: f[0]:=G(x): for n from 1 to 21 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..19); # Zerinvary Lajos, Apr 01 2009
Table[Sum[n!, {i, 3, n}], {n, 0, 19}] (* Zerinvary Lajos, Jul 12 2009 *) With[{nn=20},CoefficientList[Series[x^3/(1-x)^2,{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Feb 27 2025 *)
(define (A052571 n) (if (< n 2) 0 (* (- n 2) (A000142 n)))) ;; Antti Karttunen, May 07 2015
Comments