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.

A035106 1, together with numbers of the form k*(k+1) or k*(k+2), k > 0.

Original entry on oeis.org

1, 2, 3, 6, 8, 12, 15, 20, 24, 30, 35, 42, 48, 56, 63, 72, 80, 90, 99, 110, 120, 132, 143, 156, 168, 182, 195, 210, 224, 240, 255, 272, 288, 306, 323, 342, 360, 380, 399, 420, 440, 462, 483, 506, 528, 552, 575, 600, 624, 650, 675, 702, 728, 756, 783, 812, 840
Offset: 1

Views

Author

N. J. A. Sloane, revised Oct 30 2001

Keywords

Comments

Largest integer m such that every permutation (p_1, ..., p_n) of (1, ..., n) satisfies p_i * p_{i+1} >= m for some i, 1 <= i <= n-1. Equivalently, smallest integer m such that there exists a permutation (p_1, ..., p_n) of (1, ..., n) satisfying p_i * p_{i+1} <= m for every i, 1 <= i <= n-1.
Also, nonsquare positive integers m such that floor(sqrt(m)) divides m. - Max Alekseyev, Nov 27 2006
Also, for n>1, a(n) is the number of non-isomorphic simple connected undirected graphs having n+1 edges and a longest path of length n. - Nathaniel Gregg, Nov 02 2021

Examples

			n=5: we must arrange the numbers 1..5 so that the max of the products of pairs of adjacent terms is minimized. The answer is 51324, with max product = 8, so a(5) = 8.
		

Crossrefs

First differences give (essentially) A028242.
Bisections: A002378 (pronic numbers) and A005563.

Programs

  • GAP
    Concatenation([1], List([2..60], n-> (2*n*(n+2) +3*((-1)^n -1))/8)); # G. C. Greubel, Jun 10 2019
  • Haskell
    import Data.List.Ordered (union)
    a035106 n = a035106_list !! (n-1)
    a035106_list = 1 : tail (union a002378_list a005563_list)
    -- Reinhard Zumkeller, Oct 05 2015
    
  • Magma
    [1] cat [(2*n*(n+2) +3*((-1)^n -1))/8: n in [2..60]]; // G. C. Greubel, Jun 10 2019
    
  • Mathematica
    Join[{1},LinearRecurrence[{2,0,-2,1},{2,3,6,8},60]] (* or *) Join[{1}, Table[ If[EvenQ[n],(n(n+2))/4,((n-1)(n+3))/4],{n,2,60}]] (* Harvey P. Dale, May 03 2012 *)
  • PARI
    my(x='x+O('x^60)); Vec(x*(x^4-2*x^3+x^2-1)/((x-1)^3*(x+1))) \\ Altug Alkan, Oct 23 2015
    
  • PARI
    A035106(n)=!(n-1)+floor((n^2)/4+n/2); \\ R. J. Cano, Jul 24 2023
    
  • Sage
    [1]+[(2*n*(n+2) +3*((-1)^n -1))/8 for n in (2..60)] # G. C. Greubel, Jun 10 2019
    

Formula

For n > 1, a(n) = n*(n+2)/4 if n is even and (n-1)*(n+3)/4 if n is odd. - Jud McCranie, Oct 25 2001
a(n) = a(n-1) + a(n-2) - a(n-3) + 1 = A002620(n+2) + A004526(n+2). - Henry Bottomley, Mar 08 2000
a(n+2) = (2*n^2 + 12*n + 3*(-1)^n + 13)/8, with a(1)=1, i.e., a(n+2) = (n+2)*(n+4)/4 if n is even and (n+1)*(n+5)/4 if n is odd. - Vladeta Jovovic, Oct 23 2001
From Cecilia Rossiter (cecilia(AT)noticingnumbers.net), Dec 14 2004: (Start)
a(n) = a(n-2) + (n-1), where a(1) = 0, a(2) = 0.
a(n) = (2*(n+1)^2 + 3*(-1)^n - 5)/8, n>=2, with a(1)=1. (End)
For n > 1, a(n) = floor((n+1)^4/(4*(n+1)^2+1)). - Gary Detlefs, Feb 11 2010
For n > 1, a(n) = n + ceiling((1/4)*(n-1)^2) - 1. - Clark Kimberling, Jan 07 2011; corrected by Arkadiusz Wesolowski, Sep 25 2012
a(1)=1, a(2)=2, a(3)=3, a(4)=6, a(5)=8; for n > 5, a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Harvey P. Dale, May 03 2012
G.f.: x + x^2*(2-x) / ( (1+x)*(1-x)^3 ) = x*(x^4 - 2*x^3 + x^2 - 1)/((x-1)^3*(x+1)). - Vladeta Jovovic, Oct 23 2001; Harvey P. Dale, May 03 2012
a(n) = floor(n/2)*(1 + ceiling(n/2)), a(1) = 1. - Arkadiusz Wesolowski, Sep 25 2012
a(n) = ceiling((n-1)*(n+3)/4), n > 1. - Wesley Ivan Hurt, Jun 14 2013
a(n+1) - a(n) = A052938(n-2) for n > 1. - Reinhard Zumkeller, Oct 06 2015
E.g.f.: (8*x + 3*exp(-x) - (3-6*x-2*x^2)*exp(x))/8. - G. C. Greubel, Jun 10 2019
Sum_{n>=1} 1/a(n) = 11/4. - Amiram Eldar, Sep 24 2022

Extensions

Edited by Max Alekseyev, Oct 09 2015
Definition modified to allow for the initial 1. - N. J. A. Sloane, May 17 2016

A064736 a(1)=1, a(2)=2; for n>0, a(2*n+2) = smallest number missing from {a(1), ... ,a(2*n)}, and a(2*n+1) = a(2*n)*a(2*n+2).

Original entry on oeis.org

1, 2, 6, 3, 12, 4, 20, 5, 35, 7, 56, 8, 72, 9, 90, 10, 110, 11, 143, 13, 182, 14, 210, 15, 240, 16, 272, 17, 306, 18, 342, 19, 399, 21, 462, 22, 506, 23, 552, 24, 600, 25, 650, 26, 702, 27, 756, 28, 812, 29, 870, 30, 930, 31, 992, 32, 1056, 33, 1122, 34, 1224, 36
Offset: 1

Views

Author

J. C. Lagarias (lagarias(AT)umich.edu), Oct 21 2001

Keywords

Comments

Let c be the smallest positive constant such that for all permutations {a_n} of the positive integers, lim inf_{n -> infinity} gcd(a_n, a_{n+1})/n <= c. This sequence shows c >= 1/2.
The definition implies that if a(n) is prime then n is even. - N. J. A. Sloane, May 23 2017
a(2n) ~ n+1 ~ n has asymptotic density 1 and a(2n-1) ~ n(n+1) ~ n^2 has asymptotic density zero. - M. F. Hasler, May 23 2017

Crossrefs

A064745 gives inverse permutation.
Interleaving of A286290 and A286291. See also A286292, A286293.

Programs

  • Haskell
    import Data.List (delete)
    a064736 n = a064736_list !! (n-1)
    a064736_list = 1 : 2 : f 1 2 [3..] where
       f u v (w:ws) = u' : w : f u' w (delete u' ws) where u' = v * w
    -- Reinhard Zumkeller, Mar 23 2012
  • Mathematica
    A064736 = {a[1]=1, a[2]=2}; a[n_] := a[n] = (an = If[OddQ[n], a[n-1]*a[n+1], First[ Complement[ Range[n], A064736]]]; AppendTo[A064736, an]; an); Table[a[n], {n, 1, 62}] (*Jean-François Alcover, Aug 07 2012 *)

Extensions

More terms from Vladeta Jovovic, Oct 21 2001
Definition clarified by N. J. A. Sloane, May 23 2017

A064796 Largest integer m such that every permutation (p_1, ..., p_n) of (1, ..., n) satisfies p_i * p_{i+1} >= m for some i, 1 <= i <= n, where p_{n+1} = p_1.

Original entry on oeis.org

1, 2, 6, 8, 12, 15, 20, 24, 30, 35, 42, 48, 56, 63, 72, 80, 90, 99, 110, 120, 132, 143, 156, 168, 182, 195, 210, 224, 240, 255, 272, 288, 306, 323, 342, 360, 380, 399, 420, 440, 462, 483, 506, 528, 552, 575, 600, 624, 650, 675, 702, 728, 756, 783, 812, 840, 870
Offset: 1

Views

Author

N. J. A. Sloane, Oct 21 2001

Keywords

Comments

Conjecture: a(n) = (n+1)(n+3)/4 for odd n, a(n) = (n)(n+4)/4 for even n. - Jud McCranie, Oct 25 2001

Examples

			n=5: we must arrange the numbers 1..5 in a circle so that the max of the products of pairs of adjacent terms is minimized. The answer is 15243, with max product = 12, so a(5) = 12.
		

Crossrefs

Programs

  • Magma
    [1,2] cat [1/8*(3-3*(-1)^n+8*n+2*n^2): n in [3..60]]; // Vincenzo Librandi, Feb 24 2017
  • Mathematica
    Join[{1,2},LinearRecurrence[{2,0,-2,1},{6,8,12,15},60]] (* Harvey P. Dale, Sep 17 2013 *)
  • PARI
    a(n)=if(n<3, n, if(n%2, (n+1)*(n+3), (n+4)*n)/4) \\ Charles R Greathouse IV, Feb 19 2017
    

Formula

For odd n > 2, a(n) = (n+1)(n+3)/4. For even n > 2, a(n) = n(n+4)/4. - David Wasserman, Aug 19 2002
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4) for n>6. G.f.: -x*(x^5-x^4-2*x^3+2*x^2+1) / ((x-1)^3*(x+1)). - Colin Barker, Aug 28 2013
For n>2: a(n)=1/8*(3-3*(-1)^n+8*n+2*n^2). - Tom Edgar, Aug 28 2013

Extensions

More terms from Naohiro Nomoto and Vladeta Jovovic, Oct 22 2001
More terms from David Wasserman, Aug 19 2002

A064797 Largest integer m such that every permutation (p_1, ..., p_n) of (1, ..., n) satisfies lcm(p_i, p_{i+1}) >= m for some i, 1 <= i <= n, where p_{n+1} = p_1.

Original entry on oeis.org

1, 2, 6, 6, 12, 12, 15, 15, 18, 18, 24, 24, 35, 35, 35, 35, 44, 44, 55, 55, 55, 55, 68, 68, 68, 68, 68, 68, 85, 85, 102, 102, 102, 102, 102, 102, 119, 119, 119, 119, 145, 145, 174, 174, 174, 174, 203, 203, 203, 203, 203, 203, 232, 232, 232, 232, 232, 232, 261, 261
Offset: 1

Views

Author

N. J. A. Sloane, Oct 21 2001

Keywords

Comments

Testing a trial value of a(n) is equivalent to searching for a Hamiltonian cycle in the appropriate graph. - Martin Fuller, Jul 30 2006

Examples

			n=4: we must arrange the numbers 1..4 in a circle so that the max of the lcm of pairs of adjacent terms is minimized. The answer is 1423, with max lcm = 6, so a(4) = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[Min[Max[LCM@@@Partition[#,2,1,1]]&/@Permutations[Range[n]]], {n,10}] (* Harvey P. Dale, Oct 05 2011 *) (* The program takes a long time to run and uses a great deal of memory *)

Formula

For n >= 3, a(n) >= A073818(pi(n)+1), with equality for 17 <= n <= 250 - Martin Fuller, Jul 30 2006

Extensions

More terms from Vladeta Jovovic, Oct 22 2001
a(11)-a(24) from Charles R Greathouse IV, Jul 23 2006
More terms from Martin Fuller, Jul 30 2006

A064817 Maximal number of squares among the n-1 numbers p_i + p_{i+1}, 1 <= i <= n-1, where (p_1, ..., p_n) is any permutation of (1, ..., n).

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 16, 17, 18, 19, 20, 22, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2001

Keywords

Comments

a(n) < n by definition, but if we counted the sum p_n + p_1, we could get a(n) = n for 32 <= n <= 49 (see A071984). - David Wasserman, Aug 20 2002
Can be formulated as a traveling salesman problem on a complete graph with node set {0, 1, ..., n} and edge cost -1 if i + j is a square, 0 otherwise. - Rob Pratt, Nov 07 2012
a(n) = n - 1 for 25 <= n <= 500, computed by solving corresponding TSP. - Rob Pratt, Nov 07 2012

Examples

			n=8: take 2,7,8,1,3,6,4,5 to get 5 squares: 2+7, 8+1, 1+3, 3+6, 4+5; a(8) = 5.
(1,8,9,7,2,14,11,5,4,12,13,3,6,10) gives 12 squares and no permutation of (1..14) gives more, so a(14)=12.
		

References

  • Bernardo Recamán Santos, Challenging Brainteasers, Sterling, NY, 2000, page 71, shows a(15) = 14 using 9,7,2,14,11,5,4,12,13,3,6,10,15,1,8.

Crossrefs

Programs

  • Mathematica
    a[n_] := Which[n == 1, 0, n > 30, n - 1, True, tour = FindShortestTour[Range[n], DistanceFunction -> Function[{i, j}, If[IntegerQ[Sqrt[i + j]], -1, 0]]] // Last; cnt = 0; Do[If[IntegerQ[Sqrt[tour[[i]] + tour[[i + 1]]]], cnt++], {i, 1, n}]; cnt]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 69}] (* Jean-François Alcover, Nov 04 2016 *)

Extensions

More terms from Vladeta Jovovic, Oct 23 2001
More terms from John W. Layman and Charles K. Layman (cklayman(AT)juno.com), Nov 07 2001
More terms from David Wasserman, Aug 20 2002
More terms from Rob Pratt, Nov 07 2012
Showing 1-5 of 5 results.