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.

A104512 a(n) is the minimum number that is the first of k > 1 consecutive integers whose sum equals n, or 0 if impossible.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 3, 0, 2, 1, 5, 3, 6, 2, 1, 0, 8, 3, 9, 2, 1, 4, 11, 7, 3, 5, 2, 1, 14, 4, 15, 0, 3, 7, 2, 1, 18, 8, 4, 6, 20, 3, 21, 2, 1, 10, 23, 15, 4, 8, 6, 3, 26, 2, 1, 5, 7, 13, 29, 4, 30, 14, 3, 0, 2, 1, 33, 5, 9, 7, 35, 4, 36, 17, 3, 6, 2, 1, 39, 14, 5, 19, 41, 7, 4, 20, 12, 3, 44, 2, 1, 8, 13
Offset: 1

Views

Author

Alfred S. Posamentier (asp2(AT)juno.com) and Robert G. Wilson v, Feb 23 2005

Keywords

Examples

			a(18) = 3 because 3+4+5+6 = 5+6+7 = 18 but 3 < 5.
		

References

  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 67.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{r = Ceiling[n/2]}, If[ IntegerQ[ Log[2, n]], 0, m = Range[r]; lst = Flatten[ Table[ m[[k]], {i, r}, {j, i + 1, r}, {k, i, j}], 1]; lst[[ Position[ Plus @@@ lst, n, 1, 1][[1, 1]], 1]]]]; Table[ f[n], {n, 93}] (* Robert G. Wilson v, Feb 25 2005 *)
  • PARI
    A104512(n) = if(!bitand(n,n-1), 0, my(b,d,u=1+sqrtint(2*n)); for(k=0,n-2,b = binomial(k+1,2); forstep(j=min(n,k+u),k+2,-1, d = binomial(j+1,2) - b; if(d==n,return(1+k),if(dAntti Karttunen, Mar 30 2021

Formula

a(n)=0 iff n=2^k.
a(n)=1 iff n is a triangular number (A000217).

A104513 The number of consecutive integers > 1 beginning with A104512(n), the sum of which equals n, or 0 if impossible.

Original entry on oeis.org

0, 0, 2, 0, 2, 3, 2, 0, 3, 4, 2, 3, 2, 4, 5, 0, 2, 4, 2, 5, 6, 4, 2, 3, 5, 4, 6, 7, 2, 5, 2, 0, 6, 4, 7, 8, 2, 4, 6, 5, 2, 7, 2, 8, 9, 4, 2, 3, 7, 5, 6, 8, 2, 9, 10, 7, 6, 4, 2, 8, 2, 4, 9, 0, 10, 11, 2, 8, 6, 7, 2, 9, 2, 4, 10, 8, 11, 12, 2, 5, 9, 4, 2, 8, 10, 4, 6, 11, 2, 12, 13, 8, 6, 4, 10, 3, 2, 7, 11, 8
Offset: 1

Views

Author

Alfred S. Posamentier (asp2(AT)juno.com) and Robert G. Wilson v, Feb 23 2005

Keywords

Examples

			a(18) = 4 because 3+4+5+6 = 18.
		

References

  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 67.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{r = Ceiling[n/2]}, If[ IntegerQ[ Log[2, n]], 0, m = Range[r]; lst = Flatten[ Table[ m[[k]], {i, r}, {j, i + 1, r}, {k, i, j}], 1]; Length[ lst[[ Position[ Plus @@@ lst, n, 1, 1][[1, 1]]] ]]]]; Table[ f[n], {n, 100}]
  • PARI
    A104513(n) = if(!bitand(n,n-1), 0, my(b,d,u=1+sqrtint(2*n)); for(k=0,n-2,b = binomial(k+1,2); forstep(j=min(n,k+u),k+2,-1, d = binomial(j+1,2) - b; if(d==n,return(j-k),if(dAntti Karttunen, Mar 30 2021

Formula

a(n)=0 iff n=2^k.

A104515 Difference between the maximum number of consecutive integers and the least number >1 of consecutive integers, the sum of which equals 2n.

Original entry on oeis.org

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

Views

Author

Alfred S. Posamentier (asp2(AT)juno.com) and Robert G. Wilson v, Feb 23 2005

Keywords

Comments

a(n)=0 iff n=2^k.

Examples

			a(18) = 1 because 3+4+5+6 = 5+6+7 = 18.
		

References

  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 67.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{r = Ceiling[n/2]}, If[ IntegerQ[ Log[2, n]], 0, m = Range[r]; lst = Flatten[ Table[ m[[k]], {i, r}, {j, i + 1, r}, {k, i, j}], 1]; l = Length /@ lst[[ Flatten[ Position[ Plus @@@ lst, n]]]]; Max[l] - Min[l]]]; Table[ f[2n], {n, 105}]

A104516 a(n) is the first occurrence of k in A104515, the difference between the maximum number of consecutive integers and the minimum number >1 of consecutive integers, the sum of which equals n.

Original entry on oeis.org

1, 9, 30, 15, 21, 35, 54, 45, 55, 77, 156, 91, 105, 135, 204, 153, 171, 209, 252, 231, 253, 299, 450, 325, 351, 405, 522, 435, 465, 527, 594, 561, 595, 665, 888, 703, 741, 819, 984, 861, 903, 989
Offset: 0

Views

Author

Alfred S. Posamentier (asp2(AT)juno.com) and Robert G. Wilson v, Feb 23 2005

Keywords

Comments

a(n)=0 iff n=2^k.
Where a(n)=k & a(n+2)=k+1 for k=54,252,594,...

Examples

			a(2)=30 because 4+5+6+7+8 = 9+10+11 = 30.
		

References

  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 67.

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{r = Ceiling[n/2]}, If[ IntegerQ[ Log[2, n]], 0, m = Range[r]; lst = Flatten[ Table[ m[[k]], {i, r}, {j, i + 1, r}, {k, i, j}], 1]; l = Length /@ lst[[ Flatten[ Position[ Plus @@@ lst, n]]]]; Max[l] - Min[l]]]; t = Table[0, {50}]; Do[ c = f[n]; If[ t[[c + 1]] == 0, t[[c + 1]] = n; Print[{n, c}]], {n, 10^4}]; t
Showing 1-4 of 4 results.