|
|
A343275
|
|
a(n) = |2*n - 10^length(n)|.
|
|
1
|
|
|
8, 6, 4, 2, 0, 2, 4, 6, 8, 80, 78, 76, 74, 72, 70, 68, 66, 64, 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The plot looks like multiple V shapes. A new V shape occurs for each interval n = 10^k .. 10^(k+1)-1, with the bottom of the V at a(5*10^k) = 0.
All terms are even.
|
|
LINKS
|
|
|
FORMULA
|
a(10*n) = 10*a(n).
|
|
EXAMPLE
|
n=10 has length 2, so a(10) = |20-100| = 80.
|
|
MATHEMATICA
|
Table[Abs[2n-10^IntegerLength[n]], {n, 70}] (* Harvey P. Dale, Dec 11 2022 *)
|
|
PROG
|
(Python)
def a(n : int) -> int:
return abs((n << 1) - (10 ** len(str(n))))
(PARI) a(n) = abs(2*n-10^max(1, #digits(n))) \\ Rémy Sigrist, May 30 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|