|
|
A260586
|
|
Concatenated sums of pairs of adjacent digits in the concatenation of the numbers from 1 to n.
|
|
1
|
|
|
0, 0, 3, 35, 357, 3579, 357911, 35791113, 3579111315, 357911131517, 357911131517101, 35791113151710112, 3579111315171011223, 357911131517101122334, 35791113151710112233445, 3579111315171011223344556, 357911131517101122334455667, 35791113151710112233445566778
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
The underlying sequence to calculate the sums of the pairs of adjacent digits is A007908 = (0, 1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678910, 1234567891011, ...).
|
|
LINKS
|
|
|
EXAMPLE
|
For n=3, A007908(3) is 123, and (1+2)_(2+3) gives 35, so a(3)=35.
For n=4, A007908(4) is 1234, and (1+2)_(2+3)_(3+4) gives 357, so a(4)=357.
|
|
MATHEMATICA
|
Table[FromDigits[Flatten[IntegerDigits/@Total/@Partition[Flatten[ IntegerDigits/@ Range[n]], 2, 1]]], {n, 0, 20}] (* Harvey P. Dale, Dec 18 2019 *)
|
|
PROG
|
(PARI) b(n)=my(s=""); for(k=1, n, s=Str(s, k)); eval(s);
a(n) = {my(x = b(n)); if (x==0, d = [0], d = digits(x)); my(s=""); for (k=1, #d-1, s = concat(s, d[k] + d[k+1]); ); if (!#s, 0, eval(s)); } \\ Michel Marcus, Jul 30 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,base,nonn,less
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|