OFFSET
0,5
COMMENTS
Alternating digit sum in primorial base, starting with a positive sign for the rightmost (least significant) digit.
LINKS
EXAMPLE
A049345(85) = 2401, thus the sum of digits at even positions (with the rightmost digit having index 0) is 1+4 = 5, and at the odd positions 0+2 = 2, therefore a(85) = 5-2 = 3.
PROG
(PARI) A373605(n) = { my(p=2, i=1, s=0); while(n, s += i*(n%p); n = n\p; p = nextprime(1+p); i = -i); (s); };
CROSSREFS
KEYWORD
sign,base,easy
AUTHOR
Antti Karttunen, Jun 18 2024
STATUS
approved