OFFSET
1,2
COMMENTS
Decimal -1 in negadecimal is 19, decimal 19 in negadecimal is 199, decimal 199 in negadecimal is 219, ....
MATHEMATICA
negaDecimal[n_] := Mod[NestWhileList[Function[k, (Mod[k, 10]-k)/10], n, # != 0&], 10] // Reverse // Rest // FromDigits; a[1] = -1; a[n_] := a[n] = negaDecimal[a[n-1]]; Array[a, 40] (* Jean-François Alcover, Nov 23 2016 *)
PROG
(HP 49G calculator) Given a(n) the program produces a(n+1).
::
CK1&Dispatch
# FF
::
Z10_
ZINT -10
FPTR2 ^2LAMBIND
NULL$SWAP
BEGIN
1GETLAM
FPTR2 ^IDIV2
FPTR2 ^DupQIsZero?
?SKIP
::
2GETLAM
FPTR2 ^RADDext
SWAP
Z1_
FPTR2 ^RADDext
SWAP
;
FPTR2 ^Z>S
ROT
&$SWAP
FPTR2 ^DupQIsZero?
UNTIL
ABND
DROP
FPTR2 ^S>Z
;
;
CROSSREFS
KEYWORD
sign,base
AUTHOR
Gerald Hillier, Apr 23 2015
STATUS
approved