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

A006063 A card-arranging problem: values of n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a cube for every i.

Original entry on oeis.org

7, 19, 26, 37, 44, 56, 63, 66, 68, 80, 82, 85, 87, 98, 100, 103, 105, 110, 112, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 135, 147, 149, 150, 151, 152, 155, 156, 159, 171, 173, 174, 175, 176, 177, 178, 179
Offset: 1

Views

Author

Keywords

Comments

Apparently Gardner (1975) quotes Papaikonomou as showing that there can be at most one solution for a given n. However, this is incorrect: see A096680 for n values with more than one such permutation. - Ray Chandler
For any n, the number of permutations is permanent(m), where the n X n matrix m is defined m(i,j) = 1 or 0, depending on whether i+j is a cube or not. Hence, n is in this sequence if permanent(m) > 0.

References

  • M. Gardner, Mathematical Games column, Scientific American, Mar 1975.
  • M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 81.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A095986 (for squares), A096680.

Formula

Conjecture: a(n) = n + 124 for n >= 173, i.e. there is such a permutation for every n >= 173. Verified for 173 <= n <= 1000. - Robert Israel, Aug 28 2018

Extensions

Entry revised Jul 18 2004 based on comments from Franklin T. Adams-Watters
a(8) and later terms from Ray Chandler, Jul 26 2004

A097082 Number of permutations p of (1,2,3,...,n) such that k+p(k) is a Fibonacci number for 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 4, 2, 1, 4, 4, 20, 4, 5, 1, 20, 24, 8, 96, 200, 24, 4, 25, 1, 3, 200, 48, 288, 48, 64, 2304, 1600, 10800, 288, 432, 8, 675, 650, 1, 26, 9, 10400, 1600, 576, 2304, 23040, 576, 2560, 1024, 368640, 516096, 128000, 2240000, 5832000, 32256, 2304, 46656, 64, 96, 91125, 3750, 84500, 6, 1, 676, 9, 261
Offset: 0

Views

Author

John W. Layman, Jul 23 2004

Keywords

Comments

See A097083 for the positive values of n such that a(n) = 1.

Crossrefs

Programs

  • Mathematica
    nmax=67; A010056[n_]:=With[{fibs=Fibonacci[Range[nmax]]}, If[MemberQ[fibs, n], 1, 0]]; a[n_]:=Permanent[Table[If[A010056[i+j]==1,1,0],{i,n},{j,n}]]; Join[{1},Array[a,nmax]] (* Stefano Spezia, Mar 03 2024 *)

Formula

a(n) = permanent(m), where the n X n matrix m is defined by m(i,j) = 1 or 0 depending on whether i+j is a Fibonacci number or not.

Extensions

a(30)-a(50) from Ray Chandler, Jul 26 2004
More terms from David Wasserman, Dec 19 2007
a(0)=1 prepended by Stefano Spezia, Mar 04 2024

A096680 A card-arranging problem: values of n such that there exists more than one permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a cube for every i.

Original entry on oeis.org

112, 115, 116, 117, 119, 124, 125, 126, 127, 128, 129, 130, 133, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212
Offset: 1

Views

Author

Ray Chandler, Jul 25 2004

Keywords

Examples

			117 is in the sequence with permutations
(7,6,...,2,1,117,116,...,9,8) and
(26,25,...,2,1,98,97,...28,27,117,116,...,100,99)
		

Crossrefs

A096901 Number of permutations p of (1,2,3,...,n) such that k+p(k) is a triangular number for 1<=k<=n.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 1, 2, 4, 3, 9, 14, 13, 52, 124, 161, 181, 715, 2338, 7073, 8624, 15466, 52858, 150365, 316543, 691771, 1681604, 5324919, 15407311, 37417775, 69725286, 155786456, 579599171, 2600274145, 10530031625, 22971756045, 47057778714, 112946192928
Offset: 0

Views

Author

Ray Chandler, Jul 26 2004

Keywords

Crossrefs

Formula

a(n) = permanent(m), where the n X n matrix m is defined by m(i,j) = 1 or 0, depending on whether i+j is a triangular number or not.

Extensions

More terms from David Wasserman, Nov 27 2007
a(0) and a(31)-a(38) from Martin Ehrenstein, Mar 03 2024

A276735 Number of permutations p of (1..n) such that k+p(k) is a semiprime for 1 <= k <= n.

Original entry on oeis.org

1, 0, 0, 1, 1, 3, 5, 12, 87, 261, 324, 1433, 5881, 37444, 196797, 708901, 2020836, 12375966, 105896734, 955344450, 11136621319, 95274505723, 590283352231, 4285001635230, 36417581252044, 272699023606314
Offset: 0

Views

Author

Gary E. Davis, Sep 24 2016

Keywords

Examples

			a(4) = 1 because the permutation (3,4,1,2) added termwise to (1,2,3,4) yields (4,6,4,6) - both semiprimes - and only that permutation does so. a(5) = 3 because exactly 3 permutations - (3,2,1,5,4), (3,4,1,2,5) & (5,4,3,2,1) - added termwise to (1,2,3,4,5) yield semiprime entries.
From _David A. Corneth_, Sep 28 2016 (Start):
The semiprimes up to 10 are 4, 6, 9 and 10. To find a(5), we add (1,2,3,4,5) to some p. Therefore, p(1) in {3, 5}, p(2) in {2, 4}, p(3) in {1, 3}, p(4) in {2, 5} and p(5) in {1, 4, 5}.
If p(1) = 3 then p(3) must be 1. Then {p(2), p(4), p(5)} = {2, 4, 5} for which there are two possibilities.
If p(1) = 5 then p(3) = 3 and p(4) = 2. Then p(2) = 4 and p(5) = 1. So there's one permutation for which p(1) = 5.
This exhausts the options for p(1) and we found 3 permutations. Therefore, a(5) = 3. (End)
		

Crossrefs

Programs

  • Maple
    with(LinearAlgebra): with(numtheory):
    a:= n-> `if`(n=0, 1, Permanent(Matrix(n, (i, j)->
            `if`((s-> bigomega(s)=2)(i+j), 1, 0)))):
    seq(a(n), n=0..16);  # Alois P. Heinz, Sep 28 2016
  • Mathematica
    perms[n0_] :=
    Module[{n = n0, S, func, T, T2},
      S = Select[Range[2, 2*n], PrimeOmega[#] == 2 &];
      func[k_] := Cases[S, x_ /; 1 <= x - k <= n] - k;
      T = Tuples[Table[func[k], {k, 1, n}]];
      T2 = Cases[T, x_ /; Length[Union[x]] == Length[x]];
      Length[T2]]
    Table[perms[n], {n, 0, 12}]
    (* Second program (version >= 10): *)
    a[0] = 1; a[n_] := Permanent[Table[Boole[PrimeOmega[i + j] == 2], {i, 1, n}, {j, 1, n}]]; Table[an = a[n]; Print[an]; an, {n, 0, 20}] (* Jean-François Alcover, Jul 25 2017 *)
  • PARI
    isok(va, vb)=my(v = vector(#va, j, va[j]+vb[j])); #select(x->(bigomega(x) == 2), v) == #v;
    a(n) = my(vpo = numtoperm(n,1)); sum(k=1, n!, vp = numtoperm(n,k); isok(vp, vpo)); \\ Michel Marcus, Sep 24 2016
    
  • PARI
    listA001358(lim)=my(v=List()); forprime(p=2, sqrtint(lim\1), forprime(q=p, lim\p, listput(v, p*q))); Set(v)
    has(v)=for(k=1,#v, if(!setsearch(semi, v[k]+k), return(0))); 1
    a(n)=local(semi=listA001358(2*n)); sum(k=1,n!, has(numtoperm(n,k))) \\ Charles R Greathouse IV, Sep 28 2016
    
  • PARI
    matperm(M)=my(n=matsize(M)[1], innerSums=vectorv(n)); if(n==0, return(1)); sum(x=1,2^n-1, my(k=valuation(x,2), s=M[,k+1], gray=bitxor(x,x>>1)); if(bittest(gray,k), innerSums+=s,innerSums-=s); (-1)^hammingweight(gray)*factorback(innerSums))*(-1)^n
    a(n)=matperm(matrix(n,n,x,y,bigomega(x+y)==2)) \\ Charles R Greathouse IV, Oct 03 2016

Extensions

More terms from Alois P. Heinz, Sep 28 2016
Showing 1-5 of 5 results.