login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A240848
Sum of n, digitsum(n) and number of digits of n.
1
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 68, 70, 72, 74, 76, 78
OFFSET
0,2
COMMENTS
Difference between two consecutive terms is never greater than 2. Difference is less than zero when n is a multiple of 10.
LINKS
FORMULA
a(n) = A000027(n) + A007953(n) + A055642(n).
EXAMPLE
a(12) = 17 because n=12, sum of digits of n is 3, number of digits of n is 2, therefore 12 + 3 + 2 = 17.
MAPLE
f:= proc(n) local L;
L:= convert(n, base, 10);
n + nops(L) + convert(L, `+`)
end proc:
map(f, [$0..100]); # Robert Israel, Mar 04 2022
PROG
(PARI) a(n) = n + sumdigits(n) + if (n==0, 1, #digits(n)); \\ Michel Marcus, Apr 23 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Carmine Suriano, Apr 13 2014
STATUS
approved