cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

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

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 01 2003

Keywords

Comments

Are there any palindromes > 58985?
This sequence also gives the number of occurrences of any digit d > n (thus n < 9) in the list of all numbers from 1 to concatenation(1,...,n) = A007908(n) = A014824(n) = sum_{i=1..n} i*10^(n-i). See A277849, A061217, A277830 etc. - M. F. Hasler, Nov 01 2016, edited Nov 07 2020

Crossrefs

Cf. A061217.

Programs

  • Maple
    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
  • Mathematica
    Array[(FromDigits@ Apply[Join, Reverse@ #] - FromDigits@ Apply[Join, #])/9 &@ Map[IntegerDigits, Range[#]] &, 19] (* Michael De Vlieger, Nov 12 2020 *)
  • PARI
    apply( {A083449(n)=A019566(n)\9}, [1..20]) \\ - M. F. Hasler, Nov 07 2020

Formula

For n < 10, a(n) = ceiling((9*n-11)*(10^n+1)/729). - M. F. Hasler, Nov 07 2020

Extensions

More terms from David Wasserman, Nov 09 2004

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

Views

Author

R. J. Cano, Sep 21 2012

Keywords

Comments

Original definition: "Quotients of the polynomial remainder theorem for Diophantine equations among permutations."
The set built from the first terms of this sequence {0, 1, 10, 12, 21, 22, ....} contains the general solutions for a class of Diophantine linear equations among permutations, if one takes into account the unlimited number of distinct bases where these may be read.
From M. F. Hasler, Jan 12 2013, edited by R. J. Cano, May 08 2017: (Start)
Let P be the sequence of permutations of (0,...,m-1) interpreted as decimal numbers, P(n) = Sum_{i=1..m} 10^(m-i)*s(i) where s=(s(1),...,s(m)) is the n-th permutation (in lexicographical order), n <= m!. Then the difference P(n)-P(1) is independent of the choice of m, and divisible by 9. (Since 10 == 1 (mod 9), the numbers P(n) are all congruent (mod 9) to the sum s(1)+...+s(m).) This yields well-defined terms a(n)=(P(n)-P(1))/9.
For n>10!, P(n) will no longer be the concatenation of the "digits" (some of which will exceed 9). The pattern present in the decimal representation of the first terms will also be lost since there will be digits as large as d+1.
Note that the same a(n) is obtained independently of the chosen base b, provided that (i) 10 and 9 in the above are replaced with b and b-1, (ii) the result is (and can be) written in base b. (This implies the restriction to terms which can be written using the digits 0-9 to which the OEIS is limited.) See EXAMPLES for an illustration. (End)
We have P(n)-P(1)=a(n)*g(n), with g(n) = 9 = 10-1. Considering this and P(n) as polynomials in x=10, one can see an analogy with the polynomial remainder theorem. [Given as "formula" by R. J. Cano, rephrased by M. F. Hasler, Jan 12 2013]
Contribution by R. J. Cano, Feb 09 2013, (Start)
The maximum of the first m! terms of this sequence is given in base R by the explicit formula (please see A211869): max(m,R)=Sum_{k=1..m} k*(m-k)*R^(m-k-1);
If the first m! terms of this sequence were computed reading the permutations in base A033638(m), dividing their differences by A033638(m)-1, the resulting quotients would be written in the same way (with the same digits) in every base > A033638(m).
(End)
From R. J. Cano, Apr 29 2016, (Start)
Although in the sequence name it reads: "permutation of (0,...,m-1)", the most general statement that could replace it is: "permutation of any m-tuple of integers all of them in arithmetic progression", obtaining a multiple of this sequence, lambda*a(n), where lambda is the common difference for the progression. It works in such way because only the differences is what matters here.
Given x>1 and k>=0, if a polynomial G(x) of degree k is divided by x-1 then the remainder will be the sum of all the coefficients in G. Let us consider the case in which those coefficients are the differences among the letters ("digits") of two permutations for the same set of letters (0..x-1): The sum of all those differences must vanish. This explains how the difference between two of such permutations expressed in base x is 0 mod x-1, particularly why differences for pairs of permutations are divisible by 9.
Another way of introducing this sequence takes advantage of the fact that for n>1, n! is even. Consider for n>1 to obtain only the first n! terms. This can be done by subtracting the last permutation from the first, the penultimate permutation from the second, and so on by following the pattern (P(k)-P(n!-k+1))/9 with 1<=k<=n!. Such procedure generates an antisymmetric sequence f(k) from which a(k)=(f(k)+f(n!))/2. This partially explains why A217626 is symmetric. Also a base-independent treatment is possible using linear algebra: Column vectors and the strictly lower triangular matrix instead of the division by (r-1) where r is the base (and r=10 here for this sequence). This approach leads one to conclude that terms in this sequence are the differences between pairs of vectors made from the first n-1 partial sums of letters ("digits") taken from permutations for n consecutive letters, when components in these vectors are viewed as coefficients for a power series in r=10.
(End)

Examples

			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)
		

Crossrefs

Programs

  • C
    // See links.
    
  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    A215940(n)=for(k=2, n+1, k!M. F. Hasler, Jan 12 2013
    
  • PARI
    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

Formula

a(n) = Sum_{k=1..n-1} A217626(k).
a(n) = (A050289(n)-A050289(1))/9, for n <= 9!. - M. F. Hasler, Jan 12 2013

Extensions

Edited by M. F. Hasler, Jan 12 2013
Minor edits by N. J. A. Sloane, Feb 19 2013

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

Views

Author

R. J. Cano, Feb 02 2013

Keywords

Comments

Equivalently, a(n) is the number having the digits (j*(n-j); j=1..n-1), in base b = floor(n^2/4)+1.
From R. J. Cano, Mar 03 2018: (Start)
If a(n) were converted to the base 1+floor(n^2/4)=A033638(n) then a palindrome would be obtained. Such palindrome is related to A215940(n!);
a(7)=2541896 and A033638(7)=13, giving the palindrome "6ACCA6". Such palindrome cannot be converted directly to decimal, but it might be defined instead from these digits the polynomial f(t)= 6*t^5 +10*t^4 +12*t^3 +12*t^2+10*t^1+6*t^0, then evaluating for t=10, we get f(10)=713306=A215940(7!). 713306 clearly looks distinct than "6ACCA6". f(11) and f(12) respectively are 1130256 with "7021A6", and 1722942 with "6B10A6". Now evaluating f(14) we get 3646530 and if converted to base 14 it yields "6ACCA6". The same happens with f(15) converted to base 15, f(16) converted to Hexadecimal, and also in general for f(y) converted to base y, if it were provided that y>=13.
Here A033638(n) gives the lower bound for the infinite set of bases where this behavior can be observed. For simplicity it is chosen the base A033638(n) when defining this sequence, although what we actually want is to keep the pattern generated by the products j*(n-j). (End)
This sequence together with A033638 and A215940 demonstrates the connection among permutation sets and palindromes obtained by symmetric products. - Alexander R. Povolotsky, Feb 08 2013

Examples

			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.
		

Crossrefs

Programs

  • PARI
    a(n,base=1+n^2\4)=sum(j=1, n-1, j*(n-j)*base^(n-1-j));

Formula

a(n) = Sum_{j=1..n-1} j*(n-j)*A033638(n)^(n-1-j).

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

Views

Author

Abhinav S. Sharma, Oct 17 2020

Keywords

Comments

Note that adding a constant k does not change the result: a(n) = (Sum_{i=0..n-1} (k+i) * 10^i) - (Sum_{i=0..n-1} (k+n-1-i) * 10^i). This means any set of consecutive numbers may be used to generate the terms.
a(n) = A019566(n) for n <= 9. This is an alternate generalization of A019566 beyond n=9.
For two numbers A = Sum_{i=0..n-1} (x_i) * b^i and A' = Sum_{i=0..n-1} (x'i) * b^i, A-A' is divisible by b-1 if Sum{i=0..n-1} (x_i) = Sum_{i=0..n-1} (x'_i). x_i and x'_i are sets of integers. This is because b^i == 1 (mod b-1). In this specific case b=10, hence all terms are divisible by 9 and are given by a(n) = 9*A272525(n-1).

Crossrefs

Cf. A033713 (first differences), A019566 ("unique" numbers).

Programs

  • Mathematica
    LinearRecurrence[{22, -141, 220, -100}, {0, 9, 198, 3087}, 21] (* Amiram Eldar, Oct 26 2020 *)
  • PARI
    concat(0, Vec(9*x^2 / ((1 - x)^2*(1 - 10*x)^2) + O(x^20))) \\ Colin Barker, Oct 27 2020

Formula

a(n) = A052245(n) - A014824(n).
a(n+1) - a(n) = A033713(n+1).
a(n) = ((9*n - 11)*10^n + (9*n + 11))/81. - Andrew Howroyd, Oct 26 2020
From Colin Barker, Oct 26 2020: (Start)
G.f.: 9*x^2 / ((1 - x)^2*(1 - 10*x)^2).
a(n) = 22*a(n-1) - 141*a(n-2) + 220*a(n-3) - 100*a(n-4) for n>4.
(End)
E.g.f.: exp(x)*(11 + 9*x + exp(9*x)*(90*x - 11))/81. - Stefano Spezia, Oct 27 2020
Showing 1-4 of 4 results.