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.

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.

A118235 Smallest positive number starting an interval of consecutive integers with element sum n.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 3, 8, 2, 1, 5, 3, 6, 2, 1, 16, 8, 3, 9, 2, 1, 4, 11, 7, 3, 5, 2, 1, 14, 4, 15, 32, 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, 64, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 18 2006

Keywords

Comments

Right border of A299765. - Omar E. Pol, Jul 24 2018
In other words: a(n) is smallest part of the partitions of n into consecutive parts. - Omar E. Pol, Mar 12 2019

Examples

			a(3)=1 since 3 = 1+2; a(5)=2 since 5 = 2+3; a(6)=1 since 6 = 1+2+3; etc.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local j, k, s; j, k, s:= 1$3;
          while s<>n do
             if sAlois P. Heinz, Aug 05 2018
  • Mathematica
    a[n_] := Module[{j = 1, k = 1, s = 1}, While[True, If[s == n, Break[]]; If[s < n, k = k+1; s = s+k, s = s-j; j = j+1]]; j];
    Array[a, 100] (* Jean-François Alcover, Mar 12 2019, after Alois P. Heinz *)
  • PARI
    {a(n)=local(A=n);for(j=1,n,for(k=j,n+1,if(n==k*(k-1)/2-j*(j-1)/2,A=j;k=j=2*n+1)));A} /* Paul D. Hanna, Oct 28 2011 */

Formula

A109814(n) * (A109814(n) + 2*a(n) - 1) / 2 = n.
a(m) = n iff m = 2^k: a(A000079(n)) = A000079(n);
a(m) = 1 iff m = k*(k+1)/2: a(A000217(n)) = 1.
a(A002817(n-1)+1) = n; i.e., a(m) = n if m = k*(k-1)/2 + 1 and k = n*(n-1)/2 + 1. - Paul D. Hanna, Oct 28 2011
a(m) = 2 iff m = k*(k+3)/2: a(A000096(n)) = 2. - Bernard Schott, Mar 12 2019

A104514 a(n) = least number k > 1 of consecutive integers which sum to 2*n; or a(n) = 0 if n is a power of 2.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

a(2^k) = 0 and a(3*n) = 3.
Least proper divisor d of 4*n (if any) such that d or 4*n/d is odd. - Robert Israel, May 06 2015

Examples

			a(9) = 3 because 3+4+5+6 = 5+6+7 = 2*9 = 18.
		

References

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

Crossrefs

Programs

  • Maple
    a:= proc(n) local divs,r;
       divs:= select(t -> t::odd or (4*n/t)::odd, numtheory:-divisors(4*n) minus {1,4*n});
       if nops(divs)=0 then 0 else min(divs) fi
    end proc:
    seq(a(n), n=1..200); # Robert Israel, May 06 2015
  • 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]; Min[Length /@ lst[[Flatten[Position[Plus @@@ lst, n]]]]]]]; Table[f[2n], {n, 103}]

Formula

a(n) = A163169(2*n). Robert Israel, May 06 2015

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