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-6 of 6 results.

A217626 First differences of A215940, or first differences of permutations of (0,1,2,...,m-1) reading them as decimal numbers, divided by 9 (with 10>=m, and m! > n).

Original entry on oeis.org

1, 9, 2, 9, 1, 78, 1, 19, 3, 8, 2, 77, 2, 8, 3, 19, 1, 78, 1, 9, 2, 9, 1, 657, 1, 9, 2, 9, 1, 178, 1, 29, 4, 7, 3, 66, 2, 18, 4, 18, 2, 67, 1, 19, 3, 8, 2, 646, 1, 19, 3, 8, 2, 67, 1, 29, 4, 7, 3, 176, 3, 7, 4, 29, 1, 67, 2, 8, 3, 19, 1, 646, 2, 8, 3, 19, 1
Offset: 1

Views

Author

R. J. Cano, Oct 04 2012

Keywords

Comments

Terms do not depend on the choice of m, provided that m!>n (the index of the considered term), and the numbers associated to a permutation s of {0,...,m-1} are N(s) = Sum_{i=1..m} s(i)*10^(m-i). This defines the present sequence for any arbitrarily large index, not limited to n <= 10!, for example.
Similar sequences might be built in another base b, they would always start (1, b-1, 2, b-1, 1, ...). The partial sums of this kind of sequence would yield the analog of A215940 in the corresponding base.
There are at least two palindromic patterns which are repeated throughout this sequence: one of them is "1,b-1,2,b-1,1" (It is optional here whether or not to include the 1's), another is built from the first 4!-1 terms (See the corresponding link for details).
Also, for 1<=n<=(9!)-1: The repeating parts in the first differences of A030299 divided by nine, i.e. a(n) = A219664(n)/9. - Antti Karttunen, Dec 18 2012. Edited by: R. J. Cano, May 09 2017
There are more palindromic patterns than those mentioned above: Similar to the first 3!-1 and the first 4!-1 terms, the first k!-1 terms are repeated for all other k>4. Frequent are also multiples of these, e.g., k*[1,9,2,9,1] = [2,18,4,18,2], [3,27,6,27,3], ...), [1, 19, 3, 8, 2, 67, 1, 29, 4, 7, 3, 176, 3, 7, 4, 29, 1, 67, 2, 8, 3, 19, 1], and others. The "middle part" of roughly half the length (e.g., [9,2,9] or [67,...,67] in the last example), is repeated even more frequently. - M. F. Hasler, Jan 14 2013
From R. J. Cano, Apr 04 2016: (Start)
Conjecture 1: Given 1A217626 and so on).
Lemma: Let P be an arbitrary set consisting of m integers; let x[i] be an element in P (with 1<=i<=m); let y[j] = x[j+1] - x[j] (with 1 <= j <= m-1) be the 1st differences of P. These differences are symmetric if y[j]=y[m-j] which for P implies the condition x[j]+x[m-j+1]=x[j+1]+x[m-j];
Consequence: When m=n! and P is a set with all the permutations for the letters 0..n-1, the preceding lemma implies P has associated at least a set Q such that 1st differences in Q are symmetric.
Generating algorithm: Such Q can be built based upon P and the condition given by the preceding lemma if it is removed from P (until P becomes empty) its 1st element tau, inserting them both in Q tau and its arithmetic complement to repdigit (n-1)*111...1 (n times 1) removing the mentioned complement from P.
Conjecture 2: The autosimilarity shown by a(n) is a consequence of the fact that the corresponding P is the set of the n! permutations in increasing sequence for the letters 0..n-1, and Q=P (it holds if they are replaced "a(n)" and "increasing" respectively with "-1*a(n)" and "decreasing").
Note: "Q=P" is a necessary but not sufficient condition for observing the autosimilarity in a(n).
Application: The "generating algorithm" described previously might be potentially useful for parallel computing. In combination with the partition scheme proposed at links in A237265, and multiple indirection. For example notice that in such sense an algorithm for generating k! permutations with an increasing sequence would require only k!/2 iterations because the other half would be already determined by symmetry.
Conjecture 3: For n>2, given P the set of permutations in increasing sequence for the letters 0..n-1, there are distributed with a symmetric pattern among its (n!)! permutations all those A000165(n!\2) of them such that their 1st differences are symmetric. Moreover by setting to zero the other elements whose 1st differences are not symmetric, we obtain an antisymmetric sequence.
(End)
Conjecture 4: If 2<=mR. J. Cano, Apr 19 2017
Consider the first y!-1 terms for even y; The central term a(y!/2) is determined by the difference between the (y/2+1)th row from the y-th matrix defining the irregular table in A237265 and the consecutive permutation preceding it in lexicographic order (See EXAMPLE). - R. J. Cano, May 09 2017

Examples

			a(1)= A215940(2) - A215940(1) = 1 - 0 = 1.
a(2)= A215940(3) - A215940(2) = 10-01 = 9.
a(3)= A215940(4) - A215940(3) = 12-10 = 2.
a(4)= A215940(5) - A215940(4) = 21-12 = 9.
a(5)= A215940(6) - A215940(5) = 22-21 = 1.
From _R. J. Cano_, May 09 2017: (Start)
On the central terms for subsequences consisting of the first y!-1 terms with even y: Let us pick y=4; The first y!-1=23 terms are: (1,9,2,9,1,78,1,19,3,8,2,77,2,8,3,19,1,78,1,9,2,9,1) the central term there is a(12)=77.
If we look into A237265, the 4th matrix defining it contains as its (4/2+1)th or third row, the permutation 3124 which in lexicographic order is preceded by 2431, therefore by subtracting and dividing by 9 we obtain: (3124-2431)/9 = 693/9 = (2013-1320)/9 = 77 = a(12). (End)
		

Crossrefs

Cf. A219995 [ On the summation of 1/a(n) ].

Programs

  • C
    // See LINKS.
    
  • Maple
    A217626:=n->A215940(n+1)-A215940(n);
  • Mathematica
    maxm = 5; Table[dd = FromDigits /@ Permutations[Range[m]]; (Drop[dd, If[m == 1, 0, (m - 1)!]] - First[dd])/9, {m, 1, maxm}] // Flatten // Differences (* Jean-François Alcover, Apr 25 2013 *)
  • PARI
    first_terms(n)={n=max(3,n);my(m:small=n!);my(a:vec=vector(m-1),i:small=0,x:vec=numtoperm(n,0),y:vec,z:vec,u:small,B:small=11);m\=2;m--;while(i++<=m,u=!(i%6);y=numtoperm(n,i);z=(y-x)[1..n-1];if(u,z=vector(#z,j,vecsum(z[1..j])));a[i]=fromdigits(z,B-u);a[#a-i+1]=a[i];x=y;);z=(numtoperm(n,m+1)-y)[1..n-1];a[m+1]=fromdigits(vector(#z,j,vecsum(z[1..j])),B--);return(a)} \\ Computes the first either 5 or n!-1 terms. - R. J. Cano, May 28 2017
  • Scheme
    (define (A217626 n) (/ (A219664 n) 9)) ;; - Antti Karttunen, Dec 18 2012
    

Formula

a(n) = A215940(n+1) - A215940(n).
a(n) = A219664(n)/9, for n=1..362879. - Antti Karttunen, Dec 18 2012
a(n) = A209280(n)/9, for n < 9!. - M. F. Hasler, Jan 12 2013

Extensions

Definition simplified by M. F. Hasler, Jan 12 2013

A215907 Odd numbers n such that the Lucas number L(n) is the sum of two squares.

Original entry on oeis.org

1, 3, 7, 13, 19, 31, 37, 43, 49, 61, 67, 73, 79, 91, 111, 127, 163, 169, 183, 199, 223, 307, 313, 349, 361, 397, 433, 511, 523, 541, 613, 619, 709, 823, 907, 1087, 1123, 1129, 1147, 1213, 1279, 1434
Offset: 1

Views

Author

V. Raman, Aug 26 2012

Keywords

Comments

These Lucas numbers L(n) have no prime factor congruent to 3 mod 4 to an odd power.
Also, numbers n such that L(n) can be written in the form a^2 + 5*b^2.
Subsequence of A124132.
Is this A124132 without the 6? - Joerg Arndt, Sep 07 2012
Any prime factor of Lucas(n) for the prime values of n is always of the form 1 (mod 10) or 9 (mod 10).
A number n can be written in the form a^2 + 5*b^2 if and only if n is 0, or of the form 2^(2i) 5^j Product_{p==1 or 9 mod 20} p^k Product_{q==3 or 7 mod 20) q^(2m) or of the form 2^(2i+1) 5^j Product_{p==1 or 9 mod 20} p^k Product_{q==3 or 7 mod 20) q^(2m+1), for integers i,j,k,m, for primes p,q.
1501 <= a(42) <= 1531. 1531, 1651, 1747, 1849, 1951, 2053, 2413, 2449, 2467, 4069, 5107, 5419, 5851, 7243, 7741, 8467, 13963, 14449, 14887, 15511, 15907, 35449, 51169, 193201, 344293, 387433, 574219, 901657, 1051849 are terms. - Chai Wah Wu, Jul 22 2020

Examples

			Lucas(19) = 9349 = 95^2 + 18^2.
Lucas(19) = 9349 = 23^2 + 5*42^2.
		

Crossrefs

Cf. A180363.
Cf. A020669, A033205 (numbers and primes of the form x^2 + 5*y^2).

Programs

  • PARI
    for(i=2, 500, a=factorint(fibonacci(i-1)+fibonacci(i+1))~; has=0; for(j=1, #a, if(a[1, j]%4==3&&a[2, j]%2==1, has=1; break)); if(has==0&&i%2==1, print(i", "))) \\ a^2 + b^2 form.
    
  • PARI
    for(i=2, 500, a=factorint(fibonacci(i-1)+fibonacci(i+1))~; flag=0; flip=0; for(j=1, #a, if(((a[1, j]%20>10))&&a[2, j]%2==1, flag=1); if(((a[1, j]%20==2)||(a[1, j]%20==3)||(a[1, j]%20==7))&&a[2, j]%2==1, flip=flip+1)); if(flag==0&&flip%2==0, print(i", "))) \\ a^2 + 5*b^2 form.

Extensions

17 more terms from V. Raman, Aug 28 2012
A215940 merged into this sequence by T. D. Noe, Sep 21 2012
a(38)-a(41) from Chai Wah Wu, Jul 22 2020

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).

A219995 Decimal expansion of Sum_{n >= 1, b(n) != 1} 1/b(n)^n, where b(n) = A217626(n).

Original entry on oeis.org

1, 3, 8, 1, 5, 9, 8, 0, 6, 6, 1, 0, 6, 1, 3, 8, 7, 3, 5, 1, 4, 8, 7, 0, 9, 0, 0, 1, 0, 6, 3, 0, 8, 6, 8, 3, 0, 4, 4, 8, 5, 5, 2, 7, 7, 2, 4, 4, 3, 5, 1, 0, 6, 6, 5, 9, 7, 7, 6, 6, 9, 3, 8, 2, 3, 0, 0, 7, 6, 5, 3, 1, 7, 8, 4, 9, 6, 1, 7, 3, 6, 5, 5, 6, 6, 9, 9, 2, 7, 4, 9, 4, 9, 2, 6, 6, 8, 1, 5, 0, 5, 1, 8, 5, 1, 6, 0, 3
Offset: 0

Views

Author

R. J. Cano, Dec 02 2012

Keywords

Comments

Decimal expansion of the limit to which tends the difference between the series for 1/A217626(x) and the Gamma function evaluated for M, where 2R. J. Cano, May 25 2017

Examples

			0.138159806610613873514870900106308683044855277244...
		

Crossrefs

Programs

Extensions

Edited by N. J. A. Sloane, Dec 03 2012
Offset corrected by Rick L. Shepherd, Jan 14 2014

A243106 a(n) = Sum_{k=1..n} (-1)^isprime(k)*10^k.

Original entry on oeis.org

10, -90, -1090, 8910, -91090, 908910, -9091090, 90908910, 1090908910, 11090908910, -88909091090, 911090908910, -9088909091090, 90911090908910, 1090911090908910, 11090911090908910, -88909088909091090, 911090911090908910, -9088909088909091090
Offset: 1

Views

Author

R. J. Cano, Aug 19 2014

Keywords

Comments

Alternative definition: a(n,x)=T(x,1) for a dichromate or Tutte-Whitney polynomial in which the matrix t[i,j] is defined as t[i,j]=Delta(i,j)*((-1)^isprime(i)) and "Delta" is the Kronecker Delta function. - Michel Marcus, Aug 19 2014
If 10 is replaced by 1, then this becomes A097454. If it is replaced by 2, one gets A242002. Choosing powers of the base b=10, as done here, allows one to easily read off the equivalent for any other base b > 4, by simply replacing digits 8,9 with b-2,b-1 (when terms are written in base b). [Comment extended by M. F. Hasler, Aug 20 2014]
There are 2^n ways of taking the partial sum of the first n powers of b=10 if exponent zero is excluded and the signs can be assigned arbitrarily. Conjecture: When expressed in base b, the absolute value for any of these terms only contains digits belonging to {0,1,b-2,b-1}; here {0,1,8,9}.

Examples

			n=1 is not prime x^1 = (10)^1 = 10, therefore a(1)=10;
n=2 is prime and x^2 = (10)^2 = 100, taking it negative, a(2) = 10 - 100 = -90;
n=3 also is prime, x^3 = 1000, and we have a(3) = 10 - 100 - 1000 = -1090;
n=4 is not prime, so a(4) = 10 - 100 - 1000 + 10000 = 8910;
n=5 is prime, then a(5) = 10 - 100 - 1000 + 10000 - 100000 = -91090;
Examples of analysis for the concatenation patterns among the terms can be found at the "Additional Information" link.
		

Crossrefs

Cf. A097454.
The same kind of base-independent behavior: A215940, A217626.
Partial sums of alternating series: A181482, A222739, A213203.

Programs

  • Mathematica
    Table[Sum[ (-1)^Boole@ PrimeQ@ k*10^k, {k, n}], {n, 19}] (* Michael De Vlieger, Jan 03 2016 *)
  • PARI
    ap(n, x)={my(s); forprime(p=1, n, s+=x^p); s}
    a=(n, x=10)->(x^(n+1)-1)/(x-1)-2*ap(n, x)-1;
    
  • PARI
    Delta=(i, j)->(i==j); /* Kronecker's Delta function */
    t=n->matrix(n, n, i, j, Delta(i, j)*((-1)^isprime(i))); /* coeffs t[i, j] */
    /* Tutte polynomial over n */
    T(n, x, y)={my(t0=t(n)); sum(i=1, n, sum(j=1, n, t0[i, j]*(x^i)*(y^j)))};
    a=(n, x=10)->T(n, x, 1);
    
  • PARI
    A243106(n,b=10)=sum(k=1,n,(-1)^isprime(k)*b^k) \\ M. F. Hasler, Aug 20 2014

Formula

a(n,x) = Sum_{k=1..n} (-1)^isprime(k)*(x^k), for x=10 in decimal.

Extensions

Definition simplified by N. J. A. Sloane, Aug 19 2014
Definition further simplified and more terms from M. F. Hasler, Aug 20 2014

A212958 Array with a variable number of columns, where terms in the n-th row are the differences (computed in decimal base and divided by 9) between equal ratio permutations, found in the base n>=2, and the first (in ascending order of digits) minimal value permutation of {0,1,...,n}.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 12, 22, 0, 21, 22, 123, 131, 343, 0, 342, 343, 1234, 2531, 4664, 0, 1421, 3242, 4663, 12345, 58985, 0, 58984, 58985, 23456, 497531, 713306, 0, 137421, 276842, 436463, 575884, 713305, 713306, 1234567, 1810675, 2907844, 4002993, 6197531, 8367727
Offset: 1

Views

Author

Keywords

Comments

It is conjectured (conjecture #1 - based on the observation of the programmatical exhaustive computation results) that among all possible distinct {0,1,...,n} permutations for each base n>=2, there are at least two pairs of such permutations that yield the same ratio, equal to A221740(p)/A221741(p) = (p^2*(p+1)^p -(p+1)^p+1)/(-p^2+p*(p+1)^p+(p+1)^p-p-1) where p=n-1. Additionally it is conjectured (conjecture #2) that the number of such pairs for each n is equal to A039649(p).
Construction of the terms for the n-th row of this sequence (where n is the base, n>=2) requires pre-calculation of the (mentioned in the above conjecture #1) permutation pairs (see the StackExchange link) that have the same ratio. Given the known (as defined above) ratio, actual values of the permutation pairs for each n (there are A039649(p) such pairs for each n>=2 - as conjectured above) are findable either by trial and error, or via executing an exhaustive computer program (see the link, featuring PARI/GP program - detection script for finding the equal-ratio permutation pairs for each base in the range from 2 to 10).
The terms of this sequence should be viewed in the table layout. The above mentioned table is an array with a variable number of columns. The number of terms (columns)in n-th row is, as conjectured above, equal to 2*A039649(p). Each n-th row (rows are counted from n=2) starts with a zero term because (as conjectured - conjecture #3) the 1st in ascending order minimal value permutation of {0,1,...,n} is always present among elements of the pairs, and, as it appears, always ends with the a(n=sum(i=2...n,2*A039649(i))) term, which has a nonzero value, and always seems to be equal to A215940((n)!) - conjecture #4.
Denoting the decimal value of the number made by the concatenation of the digits of the first (identical) base-n permutation of {0,1,...,n} as Pn, and considering terms of this sequence a(n) as members of a two-dimensional array b(n,k), where n is the row number and k is the position number in the n-th row (n>1, 1 <= k <=2*A039649(p)), then (per conjecture #1) it is true that in each array row "n" there are A039649(p) pairs of decimal integer values j and l such that (b(n,j)+ Pn)/(b(n,l)+ Pn) = A221740(p)/A221741(p) for n>=2, 1 <= j <= A039649(p), 1 <= l <= j.
It also appears that in the "next" (n+1)-th row there is always present a term that is less by one in decimal value as compared with the ending term in the "previous" n-th row (conjecture #5).

Examples

			For the fourth (n=4) row, which relates to base-4 four-digit {0, 1, 2, 3} distinct permutations, there are A039649(p) pairs where p = n-1 and thus for n=4, p=3, A039649(3)=3 - so there are three pairs in the fourth row.
Those pairs are supposed to have the same ratio, which can be calculated using the expression A221740(p)/A221741(p) = (p^2*(p+1)^p - (p+1)^p+1)/(-p^2 + p*(p+1)^p + (p+1)^p - p - 1), which for n=4 (p = n-1 = 3) yields 19/9 = 2.111.
The exhaustive computer program featured in the link finds that in decimal notation those three pairs with the ratio 19/9 = 2.111... are:
  (1) {114,54}; (2) {57,27}; (3) {228,108}
In base-4 notation, those 3 pairs of distinct permutations are:
  (1) {1302, 0312}; (2) {0321,0123}; (3) {3210,1230};
Now we calculate the fourth row terms per the sequence's definition:
  (1302-0123)/9 = 131; (0312-0123)/9 = 21; (0321-0123)/9 = 22; (0123-0123)/9 = 0; (3210-0123)/9 = 343; (1230-0123)/9 = 123;
Thus, for the fourth row (n=4), which corresponds to base 4 (note that rows in the table are counted starting with n=2, which corresponds to base 2) we get the following 6 (three pairs) sequence terms, presented as sorted in ascending order: 0, 21, 22, 123, 131, 343, ...
		

Crossrefs

Showing 1-6 of 6 results.