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-4 of 4 results.

A353970 a(n) is the number of ways to write n as a sum of distinct terms of A353969.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 0, 2, 1, 1, 1, 2, 2, 0, 2, 2, 2, 0, 3, 2, 1, 2, 3, 4, 0, 5, 5, 4, 3, 6, 8, 3, 6, 8, 8, 4, 7, 10, 7, 5, 8, 11, 5, 7, 10, 10, 6, 8, 14, 9, 8, 12, 15, 10, 10, 16, 15, 10, 13, 18, 14, 11, 14, 19, 12, 11, 17, 16, 11, 12, 18, 14, 10, 14, 18, 12, 11
Offset: 0

Views

Author

Rémy Sigrist, May 14 2022

Keywords

Comments

a(0) = 1 accounts for the empty sum.

Crossrefs

Cf. A353969, A353971 (positions of 0's).

A353971 Numbers that are not the sum of distinct terms of A353969.

Original entry on oeis.org

1, 2, 6, 13, 17, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800
Offset: 1

Views

Author

Rémy Sigrist, May 14 2022

Keywords

Comments

Also positions of 0's in A353970.
This sequence is infinite as it contains the factorial numbers (A000142).

Crossrefs

A353889 Lexicographically earliest sequence of distinct positive integers with no finite subset summing to a power of 2.

Original entry on oeis.org

3, 6, 9, 11, 19, 24, 43, 69, 77, 123, 192, 261, 507, 699, 1029, 1536, 2043, 4101, 5637, 8187, 12288, 16389, 32763, 45051, 65541, 98304, 131067, 262149, 360453, 524283, 786432, 1048581, 2097147, 2883579, 4194309, 6291456, 8388603, 16777221, 23068677, 33554427
Offset: 1

Views

Author

Rémy Sigrist, May 09 2022

Keywords

Comments

The sequence is well defined:
- a(1) = 3,
- for n > 0, let k be such that 2^k + 1 + a(1) + ... + a(n) < 2^(k+1),
- then a(n+1) <= 2^k + 1.
The variant where we avoid powers of 3 corresponds to the positive even numbers (A299174).

Examples

			- 1 = 2^0, so 1 is not a term,
- 2 = 2^1, so 2 is not a term,
- a(1) = 3 (as 3 is not a power of 2),
- 4 = 2^2, so 4 is not a term,
- 3 + 5 = 2^3, so 5 is not a term,
- a(2) = 6 (as neither 6 nor 3 + 6 is a power of 2),
- 3 + 6 + 7 = 2^4, so 7 is not a term,
- 8 = 2^3, so 8 is not a term,
- a(3) = 9 (as none of 9, 3 + 9, 6 + 9, 3 + 6 + 9 is a power of 2).
		

Crossrefs

Cf. similar sequences: A052349 (prime numbers), A133662 (square numbers), A353966 (Fibonacci numbers), A353969 (factorial numbers), A353980 (primorial numbers), A353983 (Catalan numbers), A354005 (Pell numbers).

Programs

  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        a, ss, pows2, m = [], set(), {1, 2}, 2
        for k in count(1):
            if k in pows2: continue
            elif k > m: m <<= 1; pows2.add(m)
            if any(p2-k in ss for p2 in pows2): continue
            a.append(k); yield k
            ss |= {k} | {k+si for si in ss if k+si not in ss}
            while m < max(ss): m <<= 1; pows2.add(m)
    print(list(islice(agen(), 32))) # Michael S. Branicky, Jun 09 2023

A352969 Start with {1}, then at each step replace it with the set of all pairwise products and sums of its elements (an element can be paired with itself). a(n) gives the number of elements after n-th step.

Original entry on oeis.org

1, 2, 4, 11, 52, 678, 67144, 357306081
Offset: 0

Views

Author

Vladimir Reshetnikov, Apr 12 2022

Keywords

Examples

			After the 1st step the set becomes {1*1, 1+1} = {1, 2}. It has 2 distinct elements so a(1) = 2.
After the 2nd step the set becomes {1*1, 1+1, 1*2, 1+2, 2*2, 2+2} = {1, 2, 2, 3, 4, 4} = {1, 2, 3, 4}. It has 4 distinct elements so a(2) = 4.
		

Crossrefs

Programs

  • Mathematica
    Length /@ NestList[DeleteDuplicates[Flatten[Table[With[{a = #[[k]], b = #[[;; k]]}, {a b, a + b}], {k, Length[#]}]]] &, {1}, 6]
  • PARI
    lista(nn) = {my(v = [1]); print1(#v, ", "); for (n=1, nn, v = setunion(setbinop((x,y)->(x+y), v), setbinop((x,y)->(x*y), v)); print1(#v, ", "););} \\ Michel Marcus, Apr 13 2022
    
  • Python
    from math import prod
    from itertools import combinations_with_replacement
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A352969_set(n):
        if n == 0:
            return {1}
        return set(sum(x) for x in combinations_with_replacement(A352969_set(n-1),2)) | set(prod(x) for x in combinations_with_replacement(A352969_set(n-1),2))
    def A353969(n):
        return len(A352969_set(n)) # Chai Wah Wu, Apr 15 2022

Extensions

a(7) from Thomas Scheuerle, Apr 13 2022
a(7) corrected by Chai Wah Wu, Apr 15 2022
Showing 1-4 of 4 results.