cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

A110396 10's complement factorial of n: a(n) = (10's complement of n)*(10's complement of n-1)*...*(10's complement of 2)*(10's complement of 1).

Original entry on oeis.org

1, 9, 72, 504, 3024, 15120, 60480, 181440, 362880, 362880, 32659200, 2906668800, 255786854400, 22253456332800, 1913797244620800, 162672765792768000, 13664512326592512000, 1134154523107178496000, 93000670894788636672000, 7533054342477879570432000
Offset: 0

Views

Author

Amarnath Murthy, Jul 29 2005

Keywords

Examples

			a(3) = (10-3)*(10-2)*(10-1) = 7*8*9 = 504.
		

Crossrefs

Programs

  • Maple
    s:=proc(m) nops(convert(m,base,10)) end: for q from 1 to 120 do c[q]:=10^s(q)-q od: a:=n->product(c[i],i=1..n): seq(a(n),n=0..20); # Emeric Deutsch, Jul 31 2005
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 1,
           (10^length(n)-n)*a(n-1))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 22 2015
  • PARI
    a(n) = prod(i=1, n, 10^(1+logint(i, 10))-i); \\ Jinyuan Wang, Aug 09 2025
    
  • Python
    from functools import cache
    def a(n): return 1 if n == 0 else (10**len(str(n))-n)*a(n-1)
    print([a(n) for n in range(21)]) # Michael S. Branicky, Aug 13 2025

Formula

a(n) = Product_{i=1..n} c(i), where c(i) = A089186(i) is the difference between i and the next power of 10 (for example, c(13) = 100 - 13 = 87; c(100) = 1000 - 100 = 900). - Emeric Deutsch, Jul 31 2005

Extensions

More terms from Emeric Deutsch, Jul 31 2005
a(0)=1 prepended by Alois P. Heinz, Aug 13 2025

A110395 a(1) = 1. a(n) = n times (10's complement of a(n-1)).

Original entry on oeis.org

1, 18, 246, 3016, 34920, 390480, 4266640, 45866880, 487198080, 5128019200, 53591788800, 556898534400, 5760319052800, 59355533260800, 609667001088000, 6245327982592000, 63829424295936000, 651070362673152000, 6629663109210112000, 67406737815797760000
Offset: 1

Views

Author

Amarnath Murthy, Jul 29 2005

Keywords

Comments

a(1)=1; a(n)=n*[10...0 - a(n-1)] for n>1 (00...0 and a[n-1] have the same number of digits). - Emeric Deutsch, Jul 31 2005

Examples

			a(4) = 4* 10's complement of a(3) = 4*(1000-246) = 3016.
		

Crossrefs

Cf. A110394.

Programs

  • Maple
    s:=proc(m) nops(convert(m,base,10)) end: a[1]:=1: for n from 2 to 21 do a[n]:=n*(10^s(a[n-1])-a[n-1]) od: seq(a[n],n=1..21); # Emeric Deutsch, Jul 31 2005
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n,
           n*(p-> 10^length(p)-p)(a(n-1)))
        end:
    seq(a(n), n=1..25);  # Alois P. Heinz, Sep 22 2015
  • Mathematica
    a110395[numTerms_] := Block[{complement, a},
       complement[n_] := 10^IntegerLength[n] - n;
       a[n_] := a[n] = If[n == 1, 1, n*complement[a[n - 1]]];
       Table[a[n], {n, 1, numTerms}
    ]];(* Sidney Cadot, Sep 22 2015 *)
    a110395[50]

Extensions

More terms from Emeric Deutsch, Jul 31 2005
Incorrect formula and corresponding Mathematica program removed by Sidney Cadot, Sep 22 2015
Showing 1-2 of 2 results.