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.

A354765 a(n) is a binary encoded version of A355057(n).

Original entry on oeis.org

0, 0, 1, 3, 6, 7, 13, 15, 27, 59, 122, 123, 243, 499, 501, 511, 1007, 2031, 4047, 8143, 16271, 32655, 65422, 65423, 130831, 261903, 523791, 1048079, 2096651, 2096671, 4193813, 4193815, 4193311, 8387615, 16775199, 33552415, 67104799, 134213663, 268427295, 536862751, 1073725471, 2147467295, 4294934559, 8589901855, 17179803679
Offset: 1

Views

Author

Keywords

Comments

Let plist = list of forbidden primes for A090252(n); A355057(n) is the product of these primes. Then a(n) = Sum of 2^(i-1) over all prime(i) in plist.
Conversely, if a(n) has binary expansion a(n) = Sum b(i)*2^i, b(i) = 0 or 1, then plist consists of {prime(i+1) such that b(i) = 1}.

Examples

			For n = 7 the forbidden primes are 2, 5, 7 = prime(1), prime(3) and prime(4). Their product is A355057(7) = 70. Then a(7) = 2^0 + 2^2 + 2^3 = 13.
		

Crossrefs

Programs

  • Maple
    # To get first M terms:
    with(numtheory);
    M:=20; ans:=[0,0,1];
    for i from 4 to M do
    S:={}; j1:=floor((i+1)/2); j2:=i-1;
      for j from j1 to j2 do S:={op(S), op(factorset(b252[j]))} od:
    plis:=sort(convert(S,list));
    t3:=0; for ii from 1 to nops(plis) do p:=plis[ii]; p2:=pi(p); t3:=t3+2^(p2-1); od:
    ans:=[op(ans),t3];
    od:
    ans;
  • Python
    from math import gcd, lcm
    from itertools import count, islice
    from collections import deque
    from sympy import primepi, primefactors
    def A354765_gen(): # generator of terms
        aset, aqueue, c, b, f = {1}, deque([1]), 2, 1, True
        yield 0
        while True:
            for m in count(c):
                if m not in aset and gcd(m,b) == 1:
                    yield sum(2**(primepi(p)-1) for p in primefactors(b))
                    aset.add(m)
                    aqueue.append(m)
                    if f: aqueue.popleft()
                    b = lcm(*aqueue)
                    f = not f
                    while c in aset:
                        c += 1
                    break
    A354765_list = list(islice(A354765_gen(),20)) # Chai Wah Wu, Jun 18 2022