A083449
a(n) = A019566(n)/9, where A019566(n) = concat(n,...,1) - concat(1,...,n).
Original entry on oeis.org
0, 1, 22, 343, 4664, 58985, 713306, 8367627, 96021948, -150891621, -13731137410, -260644605199, 86159119727012, 19839246664059223, 3106259112208391434, 422859356777752723645, 53509280234443297055856, 6473262479112108841388067, 759559693477989774385720278
Offset: 1
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 01 2003
-
a:= n-> (parse(cat((n+1-i)$i=1..n))-parse(cat($1..n)))/9:
seq(a(n), n=1..20); # Alois P. Heinz, Nov 09 2020
-
Array[(FromDigits@ Apply[Join, Reverse@ #] - FromDigits@ Apply[Join, #])/9 &@ Map[IntegerDigits, Range[#]] &, 19] (* Michael De Vlieger, Nov 12 2020 *)
-
apply( {A083449(n)=A019566(n)\9}, [1..20]) \\ - M. F. Hasler, Nov 07 2020
A215940
Difference between the n-th and the first (identity) permutation of (0,...,m-1), interpreted as a decimal number, divided by 9 (for any m for which 10! >= m! >= n).
Original entry on oeis.org
0, 1, 10, 12, 21, 22, 100, 101, 120, 123, 131, 133, 210, 212, 220, 223, 242, 243, 321, 322, 331, 333, 342, 343, 1000, 1001, 1010, 1012, 1021, 1022, 1200, 1201, 1230, 1234, 1241, 1244, 1310, 1312, 1330, 1334, 1352, 1354, 1421, 1422, 1441, 1444, 1452, 1454, 2100
Offset: 1
From _M. F. Hasler_, Jan 12 2013, edited by _R. J. Cano_, May 09 2017: (Start)
The permutations of {0,1,2}, read as numbers, are {12, 21, 102, 120, 201, 210}. Subtracting the first one (12) from each of these numbers yields the differences {0, 9, 90, 108, 189, 198}. These are all multiples of 9, see comment and links. Dividing the differences by 9 yields {0, 1, 10, 12, 21, 22}, which are by definition the first six terms of this sequence.
Using all permutations of 0123 would yield 4!=24 terms, where the first 6 would be identical to those above. For n>10! we must consider permutations of (0,...,m-1) with m>10. These are no longer valid digits in base 10, and the numbers P(n) as defined in the comment are no longer equal to the concatenation. However, the first 10! terms obtained as (P(n)-P(1))/9, are still the same as for m=10;
In order to illustrate that the result is independent of the base chosen to make the calculation, let us consider permutations of 012 in base 3. The 3rd resp. 5th term ((102-012)/9=10 resp. (201-012)/9=21) would be ((1-0)*3^2+(0-1)*3+(2-2)*1)/(3-1) = 3 = 10[3], resp. ((2-0)*3^2+(0-1)*3+(1-2)*1)/(3-1) = 7 = 21[3]. The same terms would also be "10" and "21" if the calculation were made in base b=11. In that base, with digit "A" having the value b-1, we have (1023456789A - 0123456789A)/A = 0A000000000[11], (2013456789A - 0123456789A)/A = 02100000000[11], and (0A123456789 - 0123456789A)/A = 0A987654321[11] (the analog of (40123[5]-01234[5])/4[5] = 04321[5]). (End)
-
// See links.
-
N:= 100: # to get a(1)..a(N)
for M from 3 while M! <= N do od:
p0:= [$1..M]: p:= p0: A[1]:= 0:
for n from 2 to N do
p:= combinat:-nextperm(p);
d:= p - p0;
A[n]:= add(10^(i-1)*d[-i],i=1..M)/9;
od:
seq(A[i],i=1..N); # Robert Israel, Apr 19 2017
-
maxm = 5; Table[dd = FromDigits /@ Permutations[Range[m]]; (Drop[dd, If[m == 1, 0, (m - 1)!]] - First[dd])/9, {m, 1, maxm}] // Flatten (* Jean-François Alcover, Apr 25 2013 *)
-
A215940(n)=for(k=2, n+1, k!M. F. Hasler, Jan 12 2013
-
first_n_factorial_terms(n)={my(u=n!);my(x=numtoperm(n,0),y,z=vector(u),i:small);i=0;for(j=0,u-1,y=numtoperm(n,j)-x;z[i++]=fromdigits(vector(#x-1,k,vecsum(y[1..k]))));z} \\ R. J. Cano, Apr 19 2017
A211869
a(n) = Sum_{j=1..n-1} j*(n-j)*b^(j-1) with b = floor(n^2/4)+1.
Original entry on oeis.org
0, 1, 8, 98, 1712, 58985, 2541896, 187337236, 15687030920, 2014736789165, 280434300560320, 55591630021883014, 11642487182670742552, 3294318202343411333713, 969986091740868071844464, 371055858906757952457992360
Offset: 1
For n=5, the four products are 1*4 = 4, 2*3 = 6, 3*2 = 6, 4*1 = 4, giving the base-7 concatenation 4664. In base 10, this is a(5) = 1712.
For a(6) we have that 1+floor(6^2/4) = 10 so there is no need of converting the concatenation to decimal. By definition the products are j*(n-j) for j in 1..5: 1*(6-1) = 5 = 5*(6-5), 2*(6-2) = 8 = 4*(6-2), 3*(6-3) = 9 so the result is a(6)=58985.
A338226
a(n) = Sum_{i=0..n-1} i*10^i - Sum_{i=0..n-1} (n-1-i)*10^i.
Original entry on oeis.org
0, 9, 198, 3087, 41976, 530865, 6419754, 75308643, 864197532, 9753086421, 108641975310, 1197530864199, 13086419753088, 141975308641977, 1530864197530866, 16419753086419755, 175308641975308644, 1864197530864197533, 19753086419753086422, 208641975308641975311, 2197530864197530864200
Offset: 1
-
LinearRecurrence[{22, -141, 220, -100}, {0, 9, 198, 3087}, 21] (* Amiram Eldar, Oct 26 2020 *)
-
concat(0, Vec(9*x^2 / ((1 - x)^2*(1 - 10*x)^2) + O(x^20))) \\ Colin Barker, Oct 27 2020
Showing 1-4 of 4 results.
Comments