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.

User: Jaap Spies

Jaap Spies's wiki page.

Jaap Spies has authored 31 sequences. Here are the ten most recent ones:

A111787 a(n) is the least k >= 3 such that n can be written as sum of k consecutive integers. a(n)=0 if such a k does not exist.

Original entry on oeis.org

0, 0, 0, 0, 0, 3, 0, 0, 3, 4, 0, 3, 0, 4, 3, 0, 0, 3, 0, 5, 3, 4, 0, 3, 5, 4, 3, 7, 0, 3, 0, 0, 3, 4, 5, 3, 0, 4, 3, 5, 0, 3, 0, 8, 3, 4, 0, 3, 7, 5, 3, 8, 0, 3, 5, 7, 3, 4, 0, 3, 0, 4, 3, 0, 5, 3, 0, 8, 3, 5, 0, 3, 0, 4, 3, 8, 7, 3, 0, 5, 3, 4, 0, 3, 5, 4, 3, 11, 0, 3, 7, 8, 3, 4, 5, 3, 0, 7, 3, 5, 0, 3, 0, 13
Offset: 1

Author

Jaap Spies, Aug 16 2005

Keywords

Comments

a(n)=0 if n is an odd prime or a power of 2. For numbers of the third kind we proceed as follows: suppose n is to be written as sum of k consecutive integers starting with m, then 2n = k(2m + k - 1). Let p be the smallest odd prime divisor of n then a(n) = min(p,2n/p).

Examples

			a(15)=3 because 15=4+5+6 (k=3) and 15=2+3+4+5 (k=4)
		

References

  • Nieuw Archief voor Wiskunde 5/6 nr. 2 Problems/UWC Problem C part 3, Jun 2005, pp. 181-182

Crossrefs

Programs

  • Maple
    ispoweroftwo := proc(n) local a, t; t := 1; while (n > t) do t := 2*t end do; if (n = t) then a := true else a:= false end if; return a;end proc; A111787:= proc(n) local d, k; k:=0; if isprime(n) or ispoweroftwo(n) then return(0); fi; for d from 3 by 2 to n do if n mod d = 0 then k:=min(d,2*n/d); break; fi; od; return(k); end proc; seq(A111787(i),i=1..150);

A111775 Number of ways n can be written as a sum of at least three consecutive integers.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 2, 0, 0, 2, 0, 1, 2, 1, 0, 1, 1, 1, 2, 1, 0, 3, 0, 0, 2, 1, 2, 2, 0, 1, 2, 1, 0, 3, 0, 1, 4, 1, 0, 1, 1, 2, 2, 1, 0, 3, 2, 1, 2, 1, 0, 3, 0, 1, 4, 0, 2, 3, 0, 1, 2, 3, 0, 2, 0, 1, 4, 1, 2, 3, 0, 1, 3, 1, 0, 3, 2, 1, 2, 1, 0, 5, 2, 1, 2, 1, 2, 1, 0, 2, 4, 2, 0, 3, 0, 1
Offset: 1

Author

Jaap Spies, Aug 16 2005

Keywords

Comments

Powers of 2 and (odd) primes cannot be written as a sum of at least three consecutive integers. a(n) strongly depends on the number of odd divisors of n (A001227): Suppose n is to be written as sum of k consecutive integers starting with m, then 2n = k(2m + k - 1). Only one of the factors is odd. For each odd divisor of n there is a unique corresponding k, k=1 and k=2 must be excluded.
When the initial 0 term is a(1), a(n) is the number of times n occurs after the second column in the square array of A049777. - Bob Selcoe, Feb 14 2014
For nonnegative integers x,y where x-y>=3: a(n) equals the number of ways n can be expressed as a function of (x*(x+1)-y*(y+1))/2 when the initial 0 term is a(1). - Bob Selcoe, Feb 14 2014

Examples

			a(15) = 2 because 15 = 4+5+6 and 15 = 1+2+3+4+5. The number of odd divisors of 15 is 4.
G.f. = x^6 + x^9 + x^10 + x^12 + x^14 + 2*x^15 + 2*x^18 + x^20 + 2*x^21 + x^22 + ...
a(30) = 3 because there are 3 ways to satisfy (x*(x+1)-y*(y+1))/2 = 30 when x-y>=3: x=8, y=3; x=9, y=5; and x=11, y=8. - _Bob Selcoe_, Feb 14 2014
		

References

  • Nieuw Archief voor Wiskunde 5/6 nr. 2 Problems/UWC Problem C part 4, Jun 2005, p. 181-182

Crossrefs

Cf. A111774, A001227 (number of odd divisors), A069283.

Programs

  • Maple
    A001227:= proc(n) local d, s; s := 0: for d from 1 by 2 to n do if n mod d = 0 then s:=s+1 fi: end do: return(s); end proc; A111775:= proc(n) local k; if n=1 then return(0) fi: k := A001227(n): if type(n,even) then k:=k-1 else k:=k-2 fi: return k; end proc; seq(A111775(i), i=1..150);
  • Mathematica
    a[n_] := If[n == 1, 0, Total[Mod[Divisors[n], 2]] - Mod[n, 2] - 1];
    a /@ Range[1, 100] (* Jean-François Alcover, Oct 14 2019 *)
  • PARI
    {a(n) = local(m); if( n<1, 0, sum( i=0, n, m=0; if( issquare( 1 + 8*(n + i * (i + 1)/2), &m), m\2 > i+2)))}; /* Michael Somos, Aug 27 2012 */

Formula

If n is even then a(n) = A001227(n)-1 = A069283(n) otherwise a(n) = A001227(n)-2, for n > 1.
G.f.: Sum_{n >= 2} x^(3*n)/(1 - x^(2*n)). - Peter Bala, Jan 12 2021

A111774 Numbers that can be written as a sum of at least three consecutive positive integers.

Original entry on oeis.org

6, 9, 10, 12, 14, 15, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 102
Offset: 1

Author

Jaap Spies, Aug 15 2005

Keywords

Comments

In this sequence there are no (odd) primes and there are no powers of 2.
So we have only three kinds of natural numbers: the odd primes, the powers of 2 and the numbers that can be represented as a sum of at least three consecutive integers.
Odd primes can only be written as a sum of two consecutive integers. Powers of 2 do not have a representation as a sum of k consecutive integers (other than the trivial n=n, for k=1).
Numbers of the form (x*(x+1)-y*(y+1))/2 for nonnegative integers x,y with x-y >= 3. - Bob Selcoe, Feb 21 2014
Numbers of the form (x + 1)*(x + 2*y)/2 for integers x,y with x >= 2 and y >= 1. For y = 1 only triangular numbers (A000217) >= 6 occur. - Ralf Steiner, Jun 27 2019
From Ralf Steiner, Jul 09 2019: (Start)
If k >= 1 sequences are c_k(n) = c_k(n - 1) + n + k - 1, c_k(0) = 0, means c_k(n) = n*(n + 2*k - 1)/2: A000217, A000096, A055998, A055999, A056000, ... then this sequence is the union of c_k(n), n >= 3. (End)
From Wolfdieter Lang, Oct 28 2020: (Start)
This sequence gives all positive integers that have at least one odd prime as proper divisor. The proof follows from the first two comments.
The set {a(n)}_{n>=1} equals the set {k positive integer : floor(k/2) - delta(k) >= 1}, where delta(k) = A055034(k). Proof: floor(k/2) gives the number of positive odd numbers < k, and delta(k), gives the number of positive odd numbers coprime to k. delta(1) = 1 but 1 is not < 1, therefore k = 1 is not a member of this set. Hence a member >= 2 of this set has at least one odd number > 1 and < k missing in the set of odd numbers relative prime to k. Therefore there exists at least one odd prime < k dividing k. (End)
For the multiplicity of a(n) see A338428, obtained from triangle A337940 (the array is given Bob Selcoe as example below, and in the Ralf Steiner comment above). - Wolfdieter Lang, Dec 09 2020

Examples

			a(1)=6 because 6 is the first number that can be written as a sum of three consecutive positive integers: 6 = 1+2+3.
From _Bob Selcoe_, Feb 23 2014: (Start)
Let the top row of an array be A000217(n). Let the diagonals (reading down and left) be A000217(n)-A000217(1),  A000217(n)-A000217(2), A000217(n)-A000217(3)..., A000217(n)-A000217(n-3).  This is A049777 read as a square array, starting with the third column. The array begins as follows:
   6 10 15 21 28 36 45 55 66
   9 14 20 27 35 44 54 65
  12 18 25 33 42 52 63
  15 22 30 39 49 60
  18 26 35 45 56
  21 30 40 51
  24 34 45
  27 38
  30
This is (x*(x+1)-y*(y+1))/2 for nonnegative integers x,y with x-y >= 3, because it is equivalent to 1+2+3/+4/+5/...+x/-0/-1/-2/-3/-4/-5/...-(x+3)/ for all possible strings of consecutive integers, which represents every possible way to sum three or more consecutive positive integers. So for example, 4+5+6+7 = 1+2+3+4+5+6+7-1-2-3 = 22, which is (x*(x+1)-y*(y+1))/2 when x=7, y=3. Notice that values can appear more than once in the array because some numbers can be represented as sums of more than one string of three or more consecutive positive integers. For example, 30 = (x*(x+1)-y*(y+1))/2 when (a) x=11, y=8: 9+10+11; (b) x=9, y=5: 6+7+8+9; and (c) x=8, y=3: 4+5+6+7+8. By definition, x-y is the number of integers in the string. (End)
		

References

  • Paul Halmos, "Problems for Mathematicians, Young and Old", Dolciani Mathematical Expositions, 1991, Solution to problem 3G p. 179.

Crossrefs

Programs

  • Maple
    ispoweroftwo := proc(n) local a, t; t := 1; while (n > t) do t := 2*t end do; if (n = t) then a := true else a := false end if; return a; end proc; f:= proc(n) if (not isprime(n)) and (not ispoweroftwo(n)) then return n end if; end proc; seq(f(i),i = 1..150);
  • Mathematica
    max=6!;lst={};Do[z=n+(n+1);Do[z+=(n+x);If[z>max,Break[]];AppendTo[lst,z],{x,2,max}],{n,max}];Union[lst] (* Vladimir Joseph Stephan Orlovsky, Mar 06 2010 *)
  • PARI
    isok(n) = !(n == 1) && !isprime(n) && !(isprimepower(n, &p) && (p == 2)); \\ Michel Marcus, Jul 02 2019
    
  • Python
    from sympy import primepi
    def A111774(n):
        def f(x): return int(n+(0 if x<=1 else primepi(x)-1)+x.bit_length())
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Sep 19 2024

A090014 Permanent of (0,1)-matrix of size n X (n+d) with d=4 and n-1 zeros not on a line.

Original entry on oeis.org

5, 25, 155, 1135, 9545, 90445, 952175, 11016595, 138864365, 1893369505, 27756952355, 435287980375, 7269934161905, 128812336516885, 2413131201408695, 47652865538001595, 989254278781162325
Offset: 1

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Crossrefs

Programs

  • Mathematica
    f[x_] := x*HypergeometricPFQ[{1, 5}, {}, x/(x+1)]/(x+1); Total /@ Partition[ CoefficientList[ Series[f[x], {x, 0, 18}], x], 2, 1] // Rest (* Jean-François Alcover, Nov 12 2013, after A001909 and Mark van Hoeij *)
    t={5,25};Do[AppendTo[t,(n+3)*t[[-1]]+(n-2)*t[[-2]]],{n,3,17}];t (* Indranil Ghosh, Feb 21 2017 *)

Formula

a(n) = (n+3)*a(n-1) + (n-2)*a(n-2), a(1)=5, a(2)=25.
a(n) ~ exp(-1) * n! * n^4 / 24. - Vaclav Kotesovec, Nov 30 2017

Extensions

Corrected by Jaap Spies, Jan 26 2004

A090012 Permanent of (0,1)-matrix of size n X (n+d) with d=2 and n-1 zeros not on a line.

Original entry on oeis.org

3, 9, 39, 213, 1395, 10617, 91911, 890901, 9552387, 112203465, 1432413063, 19743404469, 292164206259, 4619383947513, 77708277841575, 1385712098571957, 26108441941918851, 518231790473609481, 10808479322484810087
Offset: 1

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Programs

  • Maple
    A090012 := proc(n,d) local r; if (n=1) then r := d+1 elif (n=2) then r := (d+1)^2 else r := (n+d-1)*A090012(n-1,d)+(n-2)*A090012(n-2,d) fi; RETURN(r); end: seq(A090012(n,2),n=1..20);
  • Mathematica
    t={3,9};Do[AppendTo[t,(n+1)*t[[-1]]+(n-2)*t[[-2]]],{n,3,19}];t (* Indranil Ghosh, Feb 21 2017 *)
    RecurrenceTable[{a[1]==3,a[2]==9,a[n]==(n+1)a[n-1]+(n-2)a[n-2]},a,{n,20}] (* Harvey P. Dale, Sep 21 2017 *)
  • Python
    # Program to generate the b-file
    print("1 3")
    print("2 9")
    a=3
    b=9
    c=(3+1)*b+(3-2)*a
    for i in range(4, 40):
        print(str(i - 1)+" "+str(c))
        a=b
        b=c
        c=(i+1)*b+(i-2)*a # Indranil Ghosh, Feb 21 2017

Formula

a(n) = (n+1)*a(n-1) + (n-2)*a(n-2), a(1)=3, a(2)=9.
a(n) = A000153(n-1) + A000153(n), a(1)=3.
G.f.: W(0)/x -1/x, where W(k) = 1 - x*(k+3)/( x*(k+2) - 1/(1 - x*(k+1)/( x*(k+1) - 1/W(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Aug 25 2013
a(n) ~ exp(-1) * n! * n^2 / 2. - Vaclav Kotesovec, Nov 30 2017

Extensions

Corrected by Jaap Spies, Jan 26 2004

A090010 Permanent of (0,1)-matrix of size n X (n+d) with d=6 and n zeros not on a line.

Original entry on oeis.org

6, 43, 356, 3333, 34754, 398959, 4996032, 67741129, 988344062, 15434831091, 256840738076, 4536075689293, 84731451264186, 1668866557980343, 34563571477305464, 750867999393119889, 17072113130285524982, 405423357986250112699, 10037458628015142154452
Offset: 1

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Programs

  • Maple
    A090010 := proc(n,d) local r; if (n=1) then r := d elif (n=2) then r := d^2+d+1 else r := (n+d-1)*A090010(n-1,d)+(n-1)*A090010(n-2,d) fi; RETURN(r); end: seq(A090010(n,6),n=1..18);
  • Mathematica
    Rest[CoefficientList[Series[E^(-x)/(1-x)^7,{x,0,20}],x]*Range[0,20]!] (* Vaclav Kotesovec, Oct 21 2012 *)
  • PARI
    x='x+O('x^66); Vec(serlaplace(-1+exp(-x)/(1-x)^7)) \\ Joerg Arndt, May 11 2013

Formula

a(n) = (n+5)*a(n-1) + (n-1)*a(n-2), a(1)=6, a(2)=43
G.f.: -1+hypergeom([1,7],[],x/(x+1))/(x+1) - Mark van Hoeij, Nov 07 2011
E.g.f.: -1 + exp(-x)/(1-x)^7. - Vaclav Kotesovec, Oct 21 2012
a(n) ~ n!*n^6/(720*e). - Vaclav Kotesovec, Oct 21 2012

Extensions

Corrected by Jaap Spies, Jan 26 2004

A090015 Permanent of (0,1)-matrix of size n X (n+d) with d=5 and n-1 zeros not on a line.

Original entry on oeis.org

6, 36, 258, 2136, 19998, 208524, 2393754, 29976192, 406446774, 5930064372, 92608986546, 1541044428456, 27216454135758, 508388707585116, 10013199347882058, 207381428863832784, 4505207996358719334
Offset: 1

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Crossrefs

Programs

  • Maple
    f:= gfun:-rectoproc({a(n) = (n+4)*a(n-1) + (n-2)*a(n-2),a(1)=6,a(2)=36},a(n),remember):
    map(f, [$1..40]); # Robert Israel, Nov 26 2018
  • Mathematica
    t={6,36};Do[AppendTo[t,(n+4)*t[[-1]]+(n-2)*t[[-2]]],{n,3,17}];t (* Indranil Ghosh, Feb 21 2017 *)
    RecurrenceTable[{a[n] == (n+4)*a[n-1] + (n-2)*a[n-2],
    a[1] == 6, a[2] == 36}, a, {n, 1, 40}] (* Jean-François Alcover, Sep 16 2022, after Robert Israel *)

Formula

a(n) = (n+4)*a(n-1) + (n-2)*a(n-2), a(1)=6, a(2)=36
a(n) ~ exp(-1) * n! * n^5 / 5!. - Vaclav Kotesovec, Nov 30 2017
a(n) = ((n^6+21*n^5+160*n^4+545*n^3+814*n^2+415*n+1)*exp(-1)*Gamma(n, -1)+(-1)^n*(n^5+20*n^4+141*n^3+422*n^2+499*n+154))/120. - Robert Israel, Nov 26 2018

Extensions

Corrected by Jaap Spies, Jan 26 2004

A090013 Permanent of (0,1)-matrix of size n X (n+d) with d=3 and n-1 zeros not on a line.

Original entry on oeis.org

4, 16, 84, 536, 4004, 34176, 327604, 3481096, 40585284, 514872176, 7058605844, 103969203576, 1637182717924, 27442553929696, 487806792137844, 9164718013496936, 181446744138509444, 3775570370986139856
Offset: 1

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Crossrefs

Programs

  • Mathematica
    t={4,16};Do[AppendTo[t,(n+2)*t[[-1]]+(n-2)*t[[-2]]],{n,3,18}];t (* Indranil Ghosh, Feb 21 2017 *)

Formula

a(n) = (n+2)*a(n-1) + (n-2)*a(n-2), a(1)=4, a(2)=16
a(n) ~ exp(-1) * n! * n^3 / 6. - Vaclav Kotesovec, Nov 30 2017

Extensions

Corrected by Jaap Spies, Jan 26 2004

A090016 Permanent of (0,1)-matrix of size n X (n+d) with d=6 and n-1 zeros not on a line.

Original entry on oeis.org

7, 49, 399, 3689, 38087, 433713, 5394991, 72737161, 1056085191, 16423175153, 272275569167, 4792916427369, 89267526953479, 1753598009244529, 36232438035285807, 785431570870425353, 17822981129678644871
Offset: 1

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Crossrefs

Programs

  • Mathematica
    t={7,49};Do[AppendTo[t,(n+5)*t[[-1]]+(n-2)*t[[-2]]],{n,3,17}];t (* Indranil Ghosh, Feb 21 2017 *)

Formula

a(n) = (n+5)*a(n-1) + (n-2)*a(n-2), a(1)=7, a(2)=49
E.g.f.: 7*exp(-x)/(1-x)^8. - Vladeta Jovovic, Mar 19 2004
a(n) = (A000166(n-1)+7*A000166(n)+21*A000166(n+1)+35*A000166(n+2)+35*A000166(n+3)+21*A000166(n+4)+7*A000166(n+5)+A000166(n+6))/6!. - Vladeta Jovovic, Mar 19 2004
a(n) ~ exp(-1) * n! * n^6 / 6!. - Vaclav Kotesovec, Nov 30 2017

Extensions

Corrected by Jaap Spies, Jan 26 2004

A079908 Solution to the Dancing School Problem with 3 girls and n+3 boys: f(3,n).

Original entry on oeis.org

1, 4, 14, 36, 76, 140, 234, 364, 536, 756, 1030, 1364, 1764, 2236, 2786, 3420, 4144, 4964, 5886, 6916, 8060, 9324, 10714, 12236, 13896, 15700, 17654, 19764, 22036, 24476, 27090, 29884, 32864, 36036, 39406, 42980, 46764, 50764, 54986, 59436
Offset: 0

Author

Jaap Spies, Jan 28 2003

Keywords

Comments

The Dancing School Problem: a line of g girls (g>0) with integer heights ranging from m to m+g-1 cm and a line of g+h boys (h>=0) ranging in height from m to m+g+h-1 cm are facing each other in a dancing school (m is the minimal height of both girls and boys).
A girl of height l can choose a boy of her own height or taller with a maximum of l+h cm. We call the number of possible matchings f(g,h).
This problem is equivalent to a rooks problem: The number of possible placings of g non-attacking rooks on a g X g+h chessboard with the restriction i <= j <= i+h for the placement of a rook on square (i,j): f(g,h) = per(B), the permanent of the corresponding (0,1)-matrix B, b(i, j)=1 if and only if i <= j <= i+h
f(g,h) = per(B), the permanent of the (0,1)-matrix B of size g X g+h with b(i,j)=1 if and only if i <= j <= i+h.
For fixed g, f(g,n) is polynomial in n for n >= g-2. See reference.

Crossrefs

Cf. Essentially the same as A061989.

Programs

Formula

a(n) = max(1, n^3 + 3*n), found by elementary counting.
G.f.: 1+2*x*(2-x+2*x^2)/(1-x)^4. - R. J. Mathar, Nov 19 2007