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-10 of 26 results. Next

A052216 Sums of two powers of 10.

Original entry on oeis.org

2, 11, 20, 101, 110, 200, 1001, 1010, 1100, 2000, 10001, 10010, 10100, 11000, 20000, 100001, 100010, 100100, 101000, 110000, 200000, 1000001, 1000010, 1000100, 1001000, 1010000, 1100000, 2000000, 10000001, 10000010, 10000100, 10001000, 10010000, 10100000, 11000000, 20000000
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

Numbers whose digit sum is 2.
A007953(a(n)) = 2; number of repdigits = #{2,11} = A242627(2) = 2. - Reinhard Zumkeller, Jul 17 2014
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

Examples

			From _Bruno Berselli_, Mar 07 2013: (Start)
The triangular array starts (see formula):
        2;
       11,      20;
      101,     110,     200;
     1001,    1010,    1100,    2000;
    10001,   10010,   10100,   11000,   20000;
   100001,  100010,  100100,  101000,  110000,  200000;
  1000001, 1000010, 1000100, 1001000, 1010000, 1100000, 2000000;
  ...
(End)
		

Crossrefs

Subsequence of A069263 and A107679. A038444 is a subsequence.
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).

Programs

  • Haskell
    a052216 n = a052216_list !! (n-1)
    a052216_list = 2 : f [2] 9 where
       f xs@(x:_) z = ys ++ f ys (10 * z) where
                      ys = (x + z) : map (* 10) xs
    -- Reinhard Zumkeller, Jan 28 2015, Jul 17 2014
    
  • Magma
    [n: n in [1..10100000] | &+Intseq(n) eq 2]; // Vincenzo Librandi, Mar 07 2013
    
  • Magma
    /* As a triangular array: */ [[10^n+10^m: m in [0..n]]: n in [0..8]]; // Bruno Berselli, Mar 07 2013
    
  • Mathematica
    t = 10^Range[0, 9]; Select[Union[Flatten[Table[i + j, {i, t}, {j, t}]]], # <= t[[-1]] + 1 &] (* T. D. Noe, Oct 09 2011 *)
    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 *)
    Select[Range[10^9], Total[IntegerDigits[#]] == 2&] (* Vincenzo Librandi, Mar 07 2013 *)
    T[n_,k_]:=10^(n-1)+10^(k-1); Table[T[n,k],{n,8},{k,n}]//Flatten (* Stefano Spezia, Nov 03 2023 *)
  • 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
    
  • Python
    from itertools import count, islice
    def agen(): yield from (10**i + 10**j for i in count(0) for j in range(i+1))
    print(list(islice(agen(), 34))) # Michael S. Branicky, May 15 2022
    
  • Python
    from math import isqrt
    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
    
  • SageMath
    def A052216(n,k): return 10^(n-1) + 10^(k-1)
    flatten([[A052216(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Feb 22 2024

Formula

T(n,k) = 10^(n-1) + 10^(k-1) with 1 <= k <= n.
a(n) = 3*A237424(n) - 1. - Reinhard Zumkeller, Jan 28 2015
a(n) = 10^A003056(n-1) + 10^A002262(n-1). - Chai Wah Wu, Apr 08 2025

A038445 Sums of 3 distinct powers of 10.

Original entry on oeis.org

111, 1011, 1101, 1110, 10011, 10101, 10110, 11001, 11010, 11100, 100011, 100101, 100110, 101001, 101010, 101100, 110001, 110010, 110100, 111000, 1000011, 1000101, 1000110, 1001001, 1001010, 1001100, 1010001, 1010010, 1010100, 1011000, 1100001, 1100010, 1100100
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Sort[Plus @@@ Subsets[10^Range[0, 6], {3}]] (* Amiram Eldar, Jul 12 2022 *)
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A038445(n): return 10**((r:=n-1-comb((m:=integer_nthroot(6*n,3)[0])+(t:=(n>comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2))+10**((a:=isqrt(s:=n-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1))+10**(m+t+1) # Chai Wah Wu, Mar 10 2025

A038446 Sums of 4 distinct powers of 10.

Original entry on oeis.org

1111, 10111, 11011, 11101, 11110, 100111, 101011, 101101, 101110, 110011, 110101, 110110, 111001, 111010, 111100, 1000111, 1001011, 1001101, 1001110, 1010011, 1010101, 1010110, 1011001, 1011010, 1011100, 1100011, 1100101, 1100110, 1101001, 1101010, 1101100, 1110001
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Total/@Subsets[10^Range[0,6],{4}]//Union (* Harvey P. Dale, Nov 07 2021 *)
  • Python
    from itertools import islice
    def A038446_gen(): # generator of terms
        yield int(bin(n:=15)[2:])
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:])
    A038446_list = list(islice(A038446_gen(),20)) # Chai Wah Wu, Mar 11 2025

Extensions

Offset corrected by Amiram Eldar, Jul 12 2022

A038464 Sums of 2 distinct powers of 3.

Original entry on oeis.org

4, 10, 12, 28, 30, 36, 82, 84, 90, 108, 244, 246, 252, 270, 324, 730, 732, 738, 756, 810, 972, 2188, 2190, 2196, 2214, 2268, 2430, 2916, 6562, 6564, 6570, 6588, 6642, 6804, 7290, 8748, 19684, 19686, 19692, 19710, 19764, 19926, 20412, 21870, 26244, 59050, 59052
Offset: 1

Views

Author

Keywords

Crossrefs

Base-3 interpretation of A038444.

Programs

  • Mathematica
    Sort[Plus @@@ Subsets[3^Range[0, 10], {2}]] (* Amiram Eldar, Jul 13 2022 *)
  • Python
    from math import isqrt
    def A038464(n): return 3**(m:=isqrt(n<<3)+1>>1)+3**(n-1-(m*(m-1)>>1)) # Chai Wah Wu, Apr 05 2025

Extensions

Offset corrected by Amiram Eldar, Jul 13 2022

A038452 Sums of 10 distinct powers of 10.

Original entry on oeis.org

1111111111, 10111111111, 11011111111, 11101111111, 11110111111, 11111011111, 11111101111, 11111110111, 11111111011, 11111111101, 11111111110, 100111111111, 101011111111, 101101111111, 101110111111, 101111011111, 101111101111, 101111110111, 101111111011, 101111111101
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Take[Union[Total/@Subsets[10^Range[0,15],{10}]],20] (* Harvey P. Dale, Dec 19 2011 *)
  • Python
    from itertools import islice
    def A038452_gen(): # generator of terms
        yield int(bin(n:=1023)[2:])
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:])
    A038452_list = list(islice(A038452_gen(),20)) # Chai Wah Wu, Mar 10 2025

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A038448 Sums of 6 distinct powers of 10.

Original entry on oeis.org

111111, 1011111, 1101111, 1110111, 1111011, 1111101, 1111110, 10011111, 10101111, 10110111, 10111011, 10111101, 10111110, 11001111, 11010111, 11011011, 11011101, 11011110, 11100111, 11101011, 11101101, 11101110, 11110011, 11110101, 11110110, 11111001, 11111010
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Sort[Plus @@@ Subsets[10^Range[0, 7], {6}]] (* Amiram Eldar, Jul 12 2022 *)
  • Python
    from itertools import islice
    def A038448_gen(): # generator of terms
        yield int(bin(n:=63)[2:])
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:])
    A038448_list = list(islice(A038448_gen(),20)) # Chai Wah Wu, Mar 11 2025

Extensions

Offset corrected by Amiram Eldar, Jul 12 2022

A038449 Sums of 7 distinct powers of 10.

Original entry on oeis.org

1111111, 10111111, 11011111, 11101111, 11110111, 11111011, 11111101, 11111110, 100111111, 101011111, 101101111, 101110111, 101111011, 101111101, 101111110, 110011111, 110101111, 110110111, 110111011, 110111101, 110111110, 111001111, 111010111, 111011011, 111011101
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Take[Total/@Subsets[10^Range[0,20],{7}]//Union,20] (* Harvey P. Dale, Feb 25 2018 *)
  • Python
    from itertools import islice
    def A038449_gen(): # generator of terms
        yield int(bin(n:=127)[2:])
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:])
    A038449_list = list(islice(A038449_gen(),20)) # Chai Wah Wu, Mar 11 2025

Extensions

Offset corrected by Amiram Eldar, Jul 12 2022

A038453 Sums of 11 distinct powers of 10.

Original entry on oeis.org

11111111111, 101111111111, 110111111111, 111011111111, 111101111111, 111110111111, 111111011111, 111111101111, 111111110111, 111111111011, 111111111101, 111111111110, 1001111111111, 1010111111111, 1011011111111, 1011101111111, 1011110111111, 1011111011111, 1011111101111
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Union[Total/@Subsets[10^Range[0,12],{11}]] (* Harvey P. Dale, Jan 20 2013 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (hammingweight(n) == 11, print1(subst(Pol(binary(n)), x, 10), ", ");););} \\ Michel Marcus, Feb 29 2016
    
  • Python
    from itertools import islice
    def A038453_gen(): # generator of terms
        yield int(bin(n:=2047)[2:])
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:])
    A038453_list = list(islice(A038453_gen(),20)) # Chai Wah Wu, Mar 11 2025

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A038454 Sums of 12 distinct powers of 10.

Original entry on oeis.org

111111111111, 1011111111111, 1101111111111, 1110111111111, 1111011111111, 1111101111111, 1111110111111, 1111111011111, 1111111101111, 1111111110111, 1111111111011, 1111111111101, 1111111111110, 10011111111111, 10101111111111, 10110111111111, 10111011111111, 10111101111111
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    N:= 14: # to get all terms of at most N digits
    sort(map(t -> (10^N-1)/9 - add(10^j, j=t),
    combinat:-choose([$0..N-1],N-12))); # Robert Israel, Feb 28 2016
  • Mathematica
    Sort[Plus @@@ Subsets[10^Range[0, 12], {12}]] (* Amiram Eldar, Jul 12 2022 *)
  • Python
    from itertools import islice
    def A038454_gen(): # generator of terms
        yield int(bin(n:=4095)[2:])
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:])
    A038454_list = list(islice(A038454_gen(),20)) # Chai Wah Wu, Mar 11 2025

Formula

a(binomial(N,12)+k) = 10^N + A038453(k) for 1 <= k <= binomial(N,11). - Robert Israel, Feb 28 2016

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A038450 Sums of 8 distinct powers of 10.

Original entry on oeis.org

11111111, 101111111, 110111111, 111011111, 111101111, 111110111, 111111011, 111111101, 111111110, 1001111111, 1010111111, 1011011111, 1011101111, 1011110111, 1011111011, 1011111101, 1011111110, 1100111111, 1101011111, 1101101111, 1101110111, 1101111011, 1101111101
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Sort[FromDigits/@Permutations[{1,1,1,1,1,1,1,1,0,0}]] (* Harvey P. Dale, Apr 29 2013 *)
  • Python
    from itertools import islice
    def A038450_gen(): # generator of terms
        yield int(bin(n:=255)[2:])
        while True: yield int(bin((n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b))[2:])
    A038450_list = list(islice(A038450_gen(),20)) # Chai Wah Wu, Mar 11 2025

Extensions

Offset corrected by Amiram Eldar, Jul 12 2022
Showing 1-10 of 26 results. Next