OFFSET
1,2
COMMENTS
All terms are divisible by 9, cf. A083449. There is an increasingly longer subsequence of negative terms starting at each power of 10, namely for indices n = 10..12, 100..123, 1000..1234, etc. - M. F. Hasler, Nov 02 2016
Gupta (1988) calls these "unique numbers".
REFERENCES
S. S. Gupta, Unique Numbers, Science Today, Jan 01 1988, India.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..350
Shyam Sunder Gupta, Unique Numbers
MAPLE
u:= proc(n) u(n):= `if`(n=1, 1, parse(cat(u(n-1), n))) end:
d:= proc(n) d(n):= `if`(n=1, 1, parse(cat(n, d(n-1)))) end:
a:= n-> d(n)-u(n):
seq(a(n), n=1..20); # Alois P. Heinz, Dec 06 2014
MATHEMATICA
f[n_] := Block[ {a = "", k = 1}, While[k < n + 1, a = StringJoin[ ToString[k], a]; k++ ]; Return[ ToExpression[a] - ToExpression[ StringReverse[a]]]]; Table[ f[n], {n, 1, 17} ]
PROG
(PARI) A = vector(25); c = 1; f = 1; for (i = 2, 9, c = 10*c + i; f = f + i*10^(i - 1); A[i] = (f - c)); for (i = 10, 25, c = 100*c + i; f = f + i*10^(2*i - 11);; A[i] = (f - c)); A \\ - David Wasserman, Nov 09 2004
(PARI) apply( {A019566(n)=A000422(n)-A007908(n)}, [1..22]) \\ Replacing code from Jan 13 2013, following a comment from Nov 02 2016. - M. F. Hasler, Nov 07 2020
CROSSREFS
KEYWORD
sign,base,easy
AUTHOR
EXTENSIONS
More terms from Robert G. Wilson v, Jan 11 2002
More terms from David Wasserman, Nov 09 2004
Edited by N. J. A. Sloane, Nov 22 2020
STATUS
approved