A275238 a(n) = n*(10^floor(log_10(n)+1) + 1) + (-1)^n.
1, 10, 23, 32, 45, 54, 67, 76, 89, 98, 1011, 1110, 1213, 1312, 1415, 1514, 1617, 1716, 1819, 1918, 2021, 2120, 2223, 2322, 2425, 2524, 2627, 2726, 2829, 2928, 3031, 3130, 3233, 3332, 3435, 3534, 3637, 3736, 3839, 3938, 4041, 4140, 4243, 4342, 4445, 4544, 4647, 4746, 4849, 4948, 5051, 5150, 5253, 5352, 5455, 5554
Offset: 0
Examples
a(0) = 0 + 1 = 1; a(1) = 11 - 1 = 10; a(2) = 22 + 1 = 23; a(3) = 33 - 1 = 32; a(4) = 44 + 1 = 45; a(5) = 55 - 1 = 54, etc. or a(0) = 1 -> concatenation of 0 with 0 + (-1)^0 = 1; a(1) = 10 -> concatenation of 1 with 1 + (-1)^1 = 0; a(2) = 23 -> concatenation of 2 with 2 + (-1)^2 = 3; a(3) = 32 -> concatenation of 3 with 3 + (-1)^3 = 2; a(4) = 45 -> concatenation of 4 with 4 + (-1)^4 = 5; a(5) = 54 -> concatenation of 5 with 5 + (-1)^5 = 4, etc. ........................................................ a(2k) = 1, 23, 45, 67, 89, 1011, 1213, 1415, 1617, 1819, ...
Crossrefs
Programs
-
Mathematica
Table[n (10^Floor[Log[10, n] + 1] + 1) + (-1)^n, {n, 0, 55}]
-
PARI
a(n) = if(n, n*(10^(logint(n,10)+1) + 1) + (-1)^n, 1) \\ Charles R Greathouse IV, Jul 21 2016
Comments