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.

A194847 Write n = C(i,3)+C(j,2)+C(k,1) with i>j>k>=0; sequence gives i values.

This page as a plain text file.
%I A194847 #24 Nov 05 2024 08:25:56
%S A194847 2,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
%T A194847 6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,
%U A194847 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10
%N A194847 Write n = C(i,3)+C(j,2)+C(k,1) with i>j>k>=0; sequence gives i values.
%C A194847 Each n >= 0 has a unique representation as n = C(i,3)+C(j,2)+C(k,1) with i>j>k>=0. This is the combinatorial number system of degree t = 3, where we get [A194847, A194848, A056558]. For degree t = 2 we get [A002024, A002262] and A138036.
%D A194847 D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.
%F A194847 Equals A056556(n) + 2.
%e A194847 The i,j,k coordinates for n equal to 0 through 10 are:
%e A194847 0, [2, 1, 0]
%e A194847 1, [3, 1, 0]
%e A194847 2, [3, 2, 0]
%e A194847 3, [3, 2, 1]
%e A194847 4, [4, 1, 0]
%e A194847 5, [4, 2, 0]
%e A194847 6, [4, 2, 1]
%e A194847 7, [4, 3, 0]
%e A194847 8, [4, 3, 1]
%e A194847 9, [4, 3, 2]
%e A194847 10, [5, 1, 0]
%p A194847 # Given x and a list a, returns smallest i such that x >= a[i].
%p A194847 whereinlist:=proc(x,a)  local i:
%p A194847 if whattype(a) <> list then ERROR(`a not a list`); fi:
%p A194847 for i from 1 to nops(a) do if x < a[i] then break; fi; od:
%p A194847 RETURN(i-1); end:
%p A194847 t3:=[seq(binomial(n,3),n=0..50)];
%p A194847 t2:=[seq(binomial(n,2),n=0..50)];
%p A194847 t1:=[seq(binomial(n,1),n=0..50)];
%p A194847 for n from 0 to 200 do
%p A194847 i3:=whereinlist(n,t3);
%p A194847 i2:=whereinlist(n-t3[i3],t2);
%p A194847 i1:=whereinlist(n-t3[i3]-t2[i2],t1);
%p A194847 L[n]:=[i3-1,i2-1,i1-1];
%p A194847 od:
%p A194847 [seq(L[n][1],n=0..200)];
%o A194847 (Python)
%o A194847 from math import comb
%o A194847 from sympy import integer_nthroot
%o A194847 def A194847(n): return (m:=integer_nthroot(6*(n+1),3)[0])+(n>=comb(m+2,3))+1 # _Chai Wah Wu_, Nov 05 2024
%Y A194847 The [i,j,k] values are [A194847, A194848, A056558], or equivalently [A056556+2, A056557+1, A056558]. See A194849 for the union list of triples.
%Y A194847 Cf. also A002024, A002262, A138036.
%K A194847 nonn
%O A194847 0,1
%A A194847 _N. J. A. Sloane_, Sep 03 2011