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.

A052216 Sums of two powers of 10.

This page as a plain text file.
%I A052216 #72 Apr 19 2025 05:56:29
%S A052216 2,11,20,101,110,200,1001,1010,1100,2000,10001,10010,10100,11000,
%T A052216 20000,100001,100010,100100,101000,110000,200000,1000001,1000010,
%U A052216 1000100,1001000,1010000,1100000,2000000,10000001,10000010,10000100,10001000,10010000,10100000,11000000,20000000
%N A052216 Sums of two powers of 10.
%C A052216 Numbers whose digit sum is 2.
%C A052216 A007953(a(n)) = 2; number of repdigits = #{2,11} = A242627(2) = 2. - _Reinhard Zumkeller_, Jul 17 2014
%C A052216 By extension, numbers k such that digitsum(k)^2 - 1 is prime. (PROOF: For any number k whose digit sum d > 2, d^2 - 1 = (d+1)*(d-1) and thus is not prime.) - _Christian N. K. Anderson_, Apr 22 2024
%H A052216 Reinhard Zumkeller, <a href="/A052216/b052216.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..48 from Vincenzo Librandi, terms 49..1036 from T. D. Noe)
%F A052216 T(n,k) = 10^(n-1) + 10^(k-1) with 1 <= k <= n.
%F A052216 a(n) = 3*A237424(n) - 1. - _Reinhard Zumkeller_, Jan 28 2015
%F A052216 a(n) = 10^A003056(n-1) + 10^A002262(n-1). - _Chai Wah Wu_, Apr 08 2025
%e A052216 From _Bruno Berselli_, Mar 07 2013: (Start)
%e A052216 The triangular array starts (see formula):
%e A052216         2;
%e A052216        11,      20;
%e A052216       101,     110,     200;
%e A052216      1001,    1010,    1100,    2000;
%e A052216     10001,   10010,   10100,   11000,   20000;
%e A052216    100001,  100010,  100100,  101000,  110000,  200000;
%e A052216   1000001, 1000010, 1000100, 1001000, 1010000, 1100000, 2000000;
%e A052216   ...
%e A052216 (End)
%t A052216 t = 10^Range[0, 9]; Select[Union[Flatten[Table[i + j, {i, t}, {j, t}]]], # <= t[[-1]] + 1 &] (* _T. D. Noe_, Oct 09 2011 *)
%t A052216 With[{nn=7},Sort[Join[Table[FromDigits[PadRight[{2},n,0]],{n,nn}], FromDigits/@Flatten[Table[Table[Insert[PadRight[{1},n,0],1,i]],{n,nn},{i,2,n+1}],1]]]] (* _Harvey P. Dale_, Nov 15 2011 *)
%t A052216 Select[Range[10^9], Total[IntegerDigits[#]] == 2&] (* _Vincenzo Librandi_, Mar 07 2013 *)
%t A052216 T[n_,k_]:=10^(n-1)+10^(k-1); Table[T[n,k],{n,8},{k,n}]//Flatten (* _Stefano Spezia_, Nov 03 2023 *)
%o A052216 (Magma) [n: n in [1..10100000] | &+Intseq(n) eq 2]; // _Vincenzo Librandi_, Mar 07 2013
%o A052216 (Magma) /* As a triangular array: */ [[10^n+10^m: m in [0..n]]: n in [0..8]]; // _Bruno Berselli_, Mar 07 2013
%o A052216 (Haskell)
%o A052216 a052216 n = a052216_list !! (n-1)
%o A052216 a052216_list = 2 : f [2] 9 where
%o A052216    f xs@(x:_) z = ys ++ f ys (10 * z) where
%o A052216                   ys = (x + z) : map (* 10) xs
%o A052216 -- _Reinhard Zumkeller_, Jan 28 2015, Jul 17 2014
%o A052216 (PARI) a(n)=my(d=(sqrtint(8*n)-1)\2,t=n-d*(d+1)/2-1); 10^d + 10^t \\ _Charles R Greathouse IV_, Dec 19 2016
%o A052216 (Python)
%o A052216 from itertools import count, islice
%o A052216 def agen(): yield from (10**i + 10**j for i in count(0) for j in range(i+1))
%o A052216 print(list(islice(agen(), 34))) # _Michael S. Branicky_, May 15 2022
%o A052216 (Python)
%o A052216 from math import isqrt
%o A052216 def A052216(n): return 10**(a:=(k:=isqrt(m:=n<<1))+(m>k*(k+1))-1)+10**(n-1-(a*(a+1)>>1)) # _Chai Wah Wu_, Apr 08 2025
%o A052216 (SageMath)
%o A052216 def A052216(n,k): return 10^(n-1) + 10^(k-1)
%o A052216 flatten([[A052216(n,k) for k in range(1,n+1)] for n in range(1,13)]) # _G. C. Greubel_, Feb 22 2024
%Y A052216 Subsequence of A069263 and A107679. A038444 is a subsequence.
%Y A052216 Sums of n powers of 10: A011557 (1), A052217 (3), 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 A052216 Cf. A002262, A003056, A007953, A242614, A242627, A237424.
%K A052216 easy,nonn,tabl
%O A052216 1,1
%A A052216 _Henry Bottomley_, Feb 01 2000