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.

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

This page as a plain text file.
%I A118235 #43 Mar 12 2019 18:30:58
%S A118235 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,
%T A118235 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,
%U A118235 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
%N A118235 Smallest positive number starting an interval of consecutive integers with element sum n.
%C A118235 Right border of A299765. - _Omar E. Pol_, Jul 24 2018
%C A118235 In other words: a(n) is smallest part of the partitions of n into consecutive parts. - _Omar E. Pol_, Mar 12 2019
%H A118235 Alois P. Heinz, <a href="/A118235/b118235.txt">Table of n, a(n) for n = 1..20000</a> (first 1000 terms from Paul D. Hanna)
%F A118235 A109814(n) * (A109814(n) + 2*a(n) - 1) / 2 = n.
%F A118235 a(m) = n iff m = 2^k: a(A000079(n)) = A000079(n);
%F A118235 a(m) = 1 iff m = k*(k+1)/2: a(A000217(n)) = 1.
%F A118235 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
%F A118235 a(m) = 2 iff m = k*(k+3)/2: a(A000096(n)) = 2. - _Bernard Schott_, Mar 12 2019
%e A118235 a(3)=1 since 3 = 1+2; a(5)=2 since 5 = 2+3; a(6)=1 since 6 = 1+2+3; etc.
%p A118235 a:= proc(n) local j, k, s; j, k, s:= 1$3;
%p A118235       while s<>n do
%p A118235          if s<n then k:= k+1; s:= s+k
%p A118235                 else s:= s-j; j:= j+1 fi
%p A118235       od: j
%p A118235     end:
%p A118235 seq(a(n), n=1..100);  # _Alois P. Heinz_, Aug 05 2018
%t A118235 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];
%t A118235 Array[a, 100] (* _Jean-François Alcover_, Mar 12 2019, after _Alois P. Heinz_ *)
%o A118235 (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 */
%Y A118235 Cf. A000079, A000217, A001227, A002817, A104512, A109814, A212652, A299765.
%K A118235 nonn,look
%O A118235 1,2
%A A118235 _Reinhard Zumkeller_, Apr 18 2006