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.

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