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.

A342966 Number of permutations tau of {1,...,n} with tau(n) = n such that p = tau(1)^(tau(2)-1) + ... + tau(n-1)^(tau(n)-1) + tau(n)^(tau(1)-1), and p - 2 and p + 6 are all prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 10, 55, 199, 1915, 13679, 86296
Offset: 2

Views

Author

Zhi-Wei Sun, Apr 01 2021

Keywords

Comments

a(n) > 0 for all n > 2.

Examples

			a(3) = 1 with p = 2^(1-1) + 1^(3-1) + 3^(2-1) = 5, p - 2 = 3 and p + 6 = 11 all prime.
a(4) = 1 with p = 1^(3-1) + 3^(2-1) + 2^(4-1) + 4^(1-1) = 13, p - 2 = 11 and p + 6 = 19 all prime.
a(5) = 1 with p = 2^(4-1) + 4^(3-1) + 3^(1-1) + 1^(5-1) + 5^(2-1) = 31, p - 2 = 29 and p + 6 = 37 all prime.
a(6) = 1 with p = 4^(3-1) + 3^(1-1) + 1^(5-1) + 5^(2-1) + 2^(6-1) + 6^(4-1) = 271, p - 2 = 269 and p + 6 = 277 all prime.
a(10) > 0 since p = 4^(8-1) + 8^(5-1) + 5^(6-1) + 6^(3-1) + 3^(9-1) + 9^(1-1) + 1^(7-1) + 7^(2-1) + 2^(10-1) + 10^(4-1) = 31723, p - 2 = 31721 and p + 6 = 31729 are all prime.
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute a(7): *)
    PQ[n_]:=PQ[n]=PrimeQ[n]&&PrimeQ[n-2]&&PrimeQ[n+6];
    V[i_]:=V[i]=Part[Permutations[{1,2,3,4,5,6}],i];
    S[i_]:=S[i]=Sum[V[i][[j]]^(V[i][[j+1]]-1), {j,1,5}]+V[i][[6]]^6+7^(V[i][[1]]-1);
    n=0;Do[If[PQ[S[i]],n=n+1],{i,1,6!}];Print[7," ",n]

Extensions

a(11)-a(13) from Jinyuan Wang, Apr 02 2021

A346387 Number of permutations f of {1,...,prime(n)-1} with f(prime(n)-1) = prime(n)-1 and f(prime(n)-2) = prime(n)-2 such that 1/(f(1)*f(2)) + 1/(f(2)*f(3)) + ... + 1/(f(prime(n)-2)*f(prime(n)-1)) + 1/(f(prime(n)-1)*f(1)) == 0 (mod prime(n)^2).

Original entry on oeis.org

0, 1, 1, 323, 21615, 301654585
Offset: 2

Views

Author

Zhi-Wei Sun, Jul 15 2021

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2. In other words, for any prime p > 3, there is a permutation f of {1,...,p-1} with f(p-1) = p-1 and f(p-2) = p-2 such that 1/(f(1)*f(2)) + 1/(f(2)*f(3)) + ... + 1/(f(p-2)*f(p-1)) + 1/(f(p-1)*f(1)) == 0 (mod p^2).
As Wolstenholme proved, for any prime p > 3 we have 1/1^2 + 1/2^2 + ... + 1/(p-1)^2 == 0 (mod p).
For any integer n > 2, clearly 1/(1*2) + 1/(2*3) + ... + 1/((n-1)*n) + 1/(n*1) = 1.

Examples

			a(3) = 1, and 1/(2*1) + 1/(1*3) + 1/(3*4) + 1/(4*2) = 5^2/24 == 0 (mod 5^2).
a(4) = 1, and 1/(2*3) + 1/(3*4) + 1/(4*1) + 1/(1*5) + 1/(5*6) + 1/(6*2) = 7^2/60 == 0 (mod 7^2).
a(5) > 0, and 1/(1*2) + 1/(2*4) + 1/(4*6) + 1/(6*3) + 1/(3*5) + 1/(5*7) + 1/(7*8) + 1/(8*9) + 1/(9*10) + 1/(10*1) = 11^2/126 == 0 (mod 11^2).
a(6) > 0, and 1/(1*2) + 1/(2*3) + 1/(3*7) + 1/(7*4) + 1/(4*9) + 1/(9*5) + 1/(5*8) + 1/(8*10) + 1/(10*6) + 1/(6*11) + 1/(11*12) + 1/(12*1) = 13^2/176 ==0 (mod 13^2).
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute a(5): *)
    VV[i_]:=Part[Permutations[{1,2,3,4,5,6,7,8}],i];
    rMod[m_,n_]:=Mod[Numerator[m]*PowerMod[Denominator[m],-1,n],n,-n/2];
    n=0;Do[If[rMod[Sum[1/(VV[i][[k]]VV[i][[k+1]]),{k,1,7}]+1/(VV[i][[8]]*9)+1/(9*10)+1/(10*VV[i][[1]]),11^2]==0,n=n+1],{i,1,8!}];Print[n]
    a[n_] := Block[{p = Prime@n, inv}, inv = ModularInverse[#, p^2] & /@ Range[p-1]; Length@ Select[ Join[#, Take[inv, -2]] & /@ Permutations[ Take[inv, p-3]], Mod[#[[1]] #[[-1]] + Total[Times @@@ Partition[#, 2, 1]], p^2] == 0 &]]; a /@ Range[2, 6] (* Giovanni Resta, Jul 15 2021 *)

Extensions

a(6)-a(7) from Giovanni Resta, Jul 15 2021

A346391 Number of permutations f of {1,...,n} with f(n) = n and f(n-1) > f(1) such that f(1)*f(2) + ... + f(n-1)*f(n) + f(n)*f(1) == 0 (mod n^2).

Original entry on oeis.org

0, 0, 0, 2, 17, 16, 209, 3192
Offset: 3

Views

Author

Zhi-Wei Sun, Jul 15 2021

Keywords

Comments

Conjecture: a(n) > 0 for all n > 5.

Examples

			a(6) = 2, and 2*4 + 4*1 + 1*3 + 3*5 + 5*6 + 6*2 = 3*5 + 5*1 + 1*2 + 2*4 + 4*6 + 6*3 = 2*6^2.
a(7) > 0 with 1*3 + 3*4 + 4*5 + 5*6 + 6*2 + 2*7 + 7*1 = 2*7^2.
a(8) > 0 with 1*5 + 5*3 + 3*6 + 6*4 + 4*7 + 7*2 + 2*8 + 8*1 = 2*8^2.
a(9) > 0 with 1*2 + 2*3 + 3*5 + 5*4 + 4*6 + 6*8 + 8*7 + 7*9 + 9*1 = 3*9^2.
a(10) > 0 with 1*2 + 2*3 + 3*6 + 6*8 + 8*4 + 4*9 + 9*7 + 7*5 + 5*10 + 10*1 = 3*10^2.
a(11) > 0 with 1*3 + 3*4 + 4*5 + 5*8 + 8*6 + 6*9 + 9*7 + 7*10 + 10*2 + 2*11 + 11*1 = 3*11^2.
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute a(7): *)
    VV[i_]:=VV[i]=Part[Permutations[{1,2,3,4,5,6}],i];
    n=0;Do[If[VV[i][[1]]
    				

A343130 Number of permutations tau of {1,...,n} with tau(1) = 1 and tau(2) = 2 such that Product_{k=1..n} k^tau(k) = (p-1)^3 for some prime p.

Original entry on oeis.org

0, 0, 0, 0, 1, 3, 2, 27, 44, 154, 1687, 2925
Offset: 2

Views

Author

Zhi-Wei Sun, Apr 05 2021

Keywords

Comments

Conjecture 1: a(n) > 0 for all n > 5.
Conjecture 2: For any integer n > 5, there is a permutation tau of {1,...,n} with tau(1) = n - 1 and tau(n) = n such that tau(1)^tau(2)*...*tau(n-1)^tau(n)*tau(n)^tau(1) = q^2 for some integer q with q - 1 and q + 1 twin prime.

Examples

			a(6) = 1, and 1^1 * 2^2 * 3^5 * 4^6 * 5^3 * 6^4 = (8461-1)^3 with 8461 prime.
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute a(8): *)
    CQ[n_]:=CQ[n]=IntegerQ[n^(1/3)]&&PrimeQ[n^(1/3)+1]
    V[i_]:=V[i]=Part[Permutations[{3,4,5,6,7,8}], i]
    S[i_]:=S[i]=4*Product[(j+2)^(V[i][[j]]),{j,1,6}]
    n=0;Do[If[CQ[S[i]],n=n+1],{i,1,6!}];Print[8," ",n]

Extensions

a(12)-a(13) from David A. Corneth, Apr 06 2021
Showing 1-4 of 4 results.