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.

A052217 Numbers whose sum of digits is 3.

This page as a plain text file.
%I A052217 #57 Dec 11 2024 11:34:05
%S A052217 3,12,21,30,102,111,120,201,210,300,1002,1011,1020,1101,1110,1200,
%T A052217 2001,2010,2100,3000,10002,10011,10020,10101,10110,10200,11001,11010,
%U A052217 11100,12000,20001,20010,20100,21000,30000,100002,100011,100020,100101
%N A052217 Numbers whose sum of digits is 3.
%C A052217 From _Joshua S.M. Weiner_, Oct 19 2012: (Start)
%C A052217 Sequence is a representation of the "energy states" of "multiplex" notation of 3 quantum of objects in a juggling pattern.
%C A052217 0 = an empty site, or empty hand. 1 = one object resides in the site. 2 = two objects reside in the site. 3 = three objects reside in the site. (See A038447.) (End)
%C A052217 A007953(a(n)) = 3; number of repdigits = #{3,111} = A242627(3) = 2. - _Reinhard Zumkeller_, Jul 17 2014
%C A052217 Can be seen as a table whose n-th row holds the n-digit terms {10^(n-1) + 10^m + 10^k, 0 <= k <= m < n}, n >= 1. Row lengths are then (1, 3, 6, 10, ...) = n*(n+1)/2 = A000217(n). The first and the n last terms of row n are 10^(n-1) + 2 resp. 2*10^(n-1) + 10^k, 0 <= k < n. - _M. F. Hasler_, Feb 19 2020
%H A052217 Alois P. Heinz, <a href="/A052217/b052217.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..84 from Vincenzo Librandi, terms 85..1140 from T. D. Noe)
%F A052217 T(n,k) = 10^(n-1) + 10^A003056(k) + 10^A002262(k) when read as a table with row lengths n*(n+1)/2, n >= 1, 0 <= k < n*(n+1)/2. - _M. F. Hasler_, Feb 19 2020
%F A052217 a(n) = 10^A056556(n-1) + 10^A056557(n-1) + 10^A056558(n-1). - _Kevin Ryde_, Apr 17 2021
%t A052217 Union[FromDigits/@Select[Flatten[Table[Tuples[Range[0,3],n],{n,6}],1],Total[#]==3&]] (* _Harvey P. Dale_, Oct 20 2012 *)
%t A052217 Select[Range[10^6], Total[IntegerDigits[#]] == 3 &] (* _Vincenzo Librandi_, Mar 07 2013 *)
%t A052217 Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 18]], {s, IntegerPartitions[3]}]]] (* _T. D. Noe_, Mar 08 2013 *)
%o A052217 (Magma) [n: n in [1..100101] | &+Intseq(n) eq 3 ]; // _Vincenzo Librandi_, Mar 07 2013
%o A052217 (Haskell)
%o A052217 a052217 n = a052217_list !! (n-1)
%o A052217 a052217_list = filter ((== 3) . a007953) [0..]
%o A052217 -- _Reinhard Zumkeller_, Jul 17 2014
%o A052217 (PARI) isok(n) = sumdigits(n) == 3; \\ _Michel Marcus_, Dec 28 2015
%o A052217 (PARI) apply( {A052217_row(n,s,t=-1)=vector(n*(n+1)\2,k,t++>s&&t=!s++;10^(n-1)+10^s+10^t)}, [1..5]) \\ _M. F. Hasler_, Feb 19 2020
%o A052217 (Python)
%o A052217 from itertools import count, islice
%o A052217 def agen(): yield from (10**i + 10**j + 10**k for i in count(0) for j in range(i+1) for k in range(j+1))
%o A052217 print(list(islice(agen(), 40))) # _Michael S. Branicky_, May 14 2022
%o A052217 (Python)
%o A052217 from math import comb, isqrt
%o A052217 from sympy import integer_nthroot
%o A052217 def A052217(n): return 10**((m:=integer_nthroot(6*n,3)[0])-(a:=n<=comb(m+2,3)))+10**((k:=isqrt(b:=(c:=n-comb(m-a+2,3))<<1))-((b<<2)<=(k<<2)*(k+1)+1))+10**(c-1-comb(k+(b>k*(k+1)),2)) # _Chai Wah Wu_, Dec 11 2024
%Y A052217 Cf. A069521 to A069530, A069532 to A069537.
%Y A052217 Cf. A007953, A218043 (subsequence).
%Y A052217 Row n=3 of A245062.
%Y A052217 Other digit sums: A011557 (1), A052216 (2), A052218 (4), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20).
%Y A052217 Other bases: A014311 (binary), A226636 (ternary), A179243 (Zeckendorf).
%Y A052217 Cf. A242614, A242627.
%Y A052217 Cf. A003056, A002262 (triangular coordinates), A056556, A056557, A056558 (tetrahedral coordinates).
%K A052217 base,easy,nonn
%O A052217 1,1
%A A052217 _Henry Bottomley_, Feb 01 2000
%E A052217 Offset changed from 0 to 1 by _Vincenzo Librandi_, Mar 07 2013