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 16 results. Next

A052217 Numbers whose sum of digits is 3.

Original entry on oeis.org

3, 12, 21, 30, 102, 111, 120, 201, 210, 300, 1002, 1011, 1020, 1101, 1110, 1200, 2001, 2010, 2100, 3000, 10002, 10011, 10020, 10101, 10110, 10200, 11001, 11010, 11100, 12000, 20001, 20010, 20100, 21000, 30000, 100002, 100011, 100020, 100101
Offset: 1

Views

Author

Henry Bottomley, Feb 01 2000

Keywords

Comments

From Joshua S.M. Weiner, Oct 19 2012: (Start)
Sequence is a representation of the "energy states" of "multiplex" notation of 3 quantum of objects in a juggling pattern.
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)
A007953(a(n)) = 3; number of repdigits = #{3,111} = A242627(3) = 2. - Reinhard Zumkeller, Jul 17 2014
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

Crossrefs

Cf. A007953, A218043 (subsequence).
Row n=3 of A245062.
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).
Other bases: A014311 (binary), A226636 (ternary), A179243 (Zeckendorf).
Cf. A003056, A002262 (triangular coordinates), A056556, A056557, A056558 (tetrahedral coordinates).

Programs

  • Haskell
    a052217 n = a052217_list !! (n-1)
    a052217_list = filter ((== 3) . a007953) [0..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Magma
    [n: n in [1..100101] | &+Intseq(n) eq 3 ]; // Vincenzo Librandi, Mar 07 2013
    
  • Mathematica
    Union[FromDigits/@Select[Flatten[Table[Tuples[Range[0,3],n],{n,6}],1],Total[#]==3&]] (* Harvey P. Dale, Oct 20 2012 *)
    Select[Range[10^6], Total[IntegerDigits[#]] == 3 &] (* Vincenzo Librandi, Mar 07 2013 *)
    Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 18]], {s, IntegerPartitions[3]}]]] (* T. D. Noe, Mar 08 2013 *)
  • PARI
    isok(n) = sumdigits(n) == 3; \\ Michel Marcus, Dec 28 2015
    
  • 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
    
  • Python
    from itertools import count, islice
    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))
    print(list(islice(agen(), 40))) # Michael S. Branicky, May 14 2022
    
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    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

Formula

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
a(n) = 10^A056556(n-1) + 10^A056557(n-1) + 10^A056558(n-1). - Kevin Ryde, Apr 17 2021

Extensions

Offset changed from 0 to 1 by Vincenzo Librandi, Mar 07 2013

A014313 Numbers with exactly 5 ones in binary expansion.

Original entry on oeis.org

31, 47, 55, 59, 61, 62, 79, 87, 91, 93, 94, 103, 107, 109, 110, 115, 117, 118, 121, 122, 124, 143, 151, 155, 157, 158, 167, 171, 173, 174, 179, 181, 182, 185, 186, 188, 199, 203, 205, 206, 211, 213, 214, 217, 218, 220, 227, 229, 230, 233, 234, 236, 241, 242
Offset: 1

Views

Author

Al Black (gblack(AT)nol.net)

Keywords

Comments

Appears to give all n such that 4096 is the highest power of 2 dividing A005148(n). - Benoit Cloitre, Jun 22 2002

Crossrefs

Cf. A000079, A018900, A014311, A014312, A023688, A023689, A023690, A023691 (Hamming weight = 1, 2, ..., 9).

Programs

  • Haskell
    a014313 = f . a038447 where
       f x = if x == 0 then 0 else 2 * f x' + b  where (x', b) = divMod x 10
    -- Reinhard Zumkeller, Jan 06 2015
    
  • Mathematica
    Select[ Range[31, 240], Total[IntegerDigits[#, 2]] == 5&]
  • PARI
    sum_of_bits(n) = if(n<1, 0, sum_of_bits(floor(n/2))+n%2)
    isA014313(n) = (sum_of_bits(n) == 5); \\ Michael B. Porter, Oct 21 2009
    
  • PARI
    is(n)=hammingweight(n)==5 \\ Charles R Greathouse IV, Nov 17 2013
    
  • PARI
    print1(t=2^5-1); for(i=2, 50, print1(", "t=A057168(t))) \\ M. F. Hasler, Aug 27 2014
    
  • Python
    from itertools import islice
    def A014313_gen(): # generator of terms
        yield (n:=31)
        while True: yield (n:=((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A014313_list = list(islice(A014313_gen(),30)) # Chai Wah Wu, Mar 06 2025

Formula

a(n+1) = A057168(a(n)). - M. F. Hasler, Aug 27 2014
A038447(n) = A007088(a(n)). - Reinhard Zumkeller, Jan 06 2015
Sum_{n>=1} 1/a(n) = 1.390704528210321982529622080740025763242354253694629591331835888395977392151... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Extension and program by Olivier Gérard

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

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 16 results. Next