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

A355634 Irregular triangle T(n, k), n > 0, k = 1..A093640(n), read by rows; the n-th row contains in ascending order the divisors of n whose binary expansions appear as substrings in the binary expansion of n.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 2, 4, 1, 5, 1, 2, 3, 6, 1, 7, 1, 2, 4, 8, 1, 9, 1, 2, 5, 10, 1, 11, 1, 2, 3, 4, 6, 12, 1, 13, 1, 2, 7, 14, 1, 3, 15, 1, 2, 4, 8, 16, 1, 17, 1, 2, 9, 18, 1, 19, 1, 2, 4, 5, 10, 20, 1, 21, 1, 2, 11, 22, 1, 23, 1, 2, 3, 4, 6, 8, 12, 24, 1, 25
Offset: 1

Views

Author

Rémy Sigrist, Jul 11 2022

Keywords

Examples

			Triangle T(n, k) begins:
     1: [1]
     2: [1, 2]
     3: [1, 3]
     4: [1, 2, 4]
     5: [1, 5]
     6: [1, 2, 3, 6]
     7: [1, 7]
     8: [1, 2, 4, 8]
     9: [1, 9]
    10: [1, 2, 5, 10]
    11: [1, 11]
    12: [1, 2, 3, 4, 6, 12]
    13: [1, 13]
    14: [1, 2, 7, 14]
    15: [1, 3, 15]
    16: [1, 2, 4, 8, 16]
		

Crossrefs

Cf. A027750, A093640 (row lengths), A355632 (decimal analog), A355633 (row sums).

Programs

  • Mathematica
    Table[Select[Divisors[n], StringContainsQ[IntegerString[n, 2], IntegerString[#, 2]] &], {n, 50}] (* Paolo Xausa, Jul 23 2024 *)
  • PARI
    row(n, base=2) = { my (d=digits(n, base), s=setbinop((i, j) -> fromdigits(d[i..j], base), [1..#d]), v=0); select(v -> v && n%v==0, s) }
    
  • Python
    from sympy import divisors
    def row(n):
        s = bin(n)[2:]
        return sorted(d for d in divisors(n, generator=True) if bin(d)[2:] in s)
    def table(r): return [i for n in range(1, r+1) for i in row(n)]
    print(table(25)) # Michael S. Branicky, Jul 11 2022

Formula

T(n, 1) = 1.
T(n, A093640(n)) = n.
Sum_{k = 1..A093640(n)} T(n, k) = A355633(n).

A093641 Numbers of form 2^i * prime(j), i>=0, j>0, together with 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 19, 20, 22, 23, 24, 26, 28, 29, 31, 32, 34, 37, 38, 40, 41, 43, 44, 46, 47, 48, 52, 53, 56, 58, 59, 61, 62, 64, 67, 68, 71, 73, 74, 76, 79, 80, 82, 83, 86, 88, 89, 92, 94, 96, 97, 101, 103, 104, 106, 107, 109, 112
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 07 2004

Keywords

Comments

a(n) is either 1, prime, or of form 2a(m), m
1 and Heinz numbers of hook integer partitions. The Heinz number of an integer partition (y_1, ..., y_k) is prime(y_1) * ... * prime(y_k). A hook is a partition of the form (n,1,1,...,1). - Gus Wiseman, Sep 15 2018
Numbers whose odd part is noncomposite. - Peter Munn, Aug 06 2020

Examples

			55 is not a member, as 5*11 is not of the form 2^i * prime.
		

Crossrefs

A093640(a(n)) = A000005(a(n)); A000040 and A000079 are subsequences.
A105440 is a subsequence, see also A105442. - Reinhard Zumkeller, Apr 09 2005
Complement of A105441; A001221(a(n))<=2; A005087(a(n))<=1; A087436(a(n))<=1.
See also A105442.
Union of A038550 and A000079, see also A008578.
Cf. A000265 (odd part), A008578 (noncomposite).

Programs

  • Haskell
    a093641 n = a093641_list !! (n-1)
    a093641_list = filter ((<= 2) . a001227) [1..]
    -- Reinhard Zumkeller, May 01 2012
    
  • Mathematica
    hookQ[n_]:=MatchQ[DeleteCases[FactorInteger[n],{2,}],{}|{{,1}}];
    Select[Range[100],hookQ] (* Gus Wiseman, Sep 15 2018 *)
  • PARI
    upTo(lim)=my(v=List([1])); for(e=0, log(lim)\log(2), forprime(p=2, lim>>e, listput(v,p<Charles R Greathouse IV, Aug 21 2011
    
  • PARI
    isok(m) = my(k=m/2^valuation(m,2)); (k == 1) || isprime(k); \\ Michel Marcus, Mar 16 2023
    
  • Python
    from sympy import primepi
    def A093641(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n-1+x-sum(primepi(x>>i) for i in range(x.bit_length()))
        return bisection(f,n,n) # Chai Wah Wu, Feb 02 2025

Formula

A001227(a(n)) <= 2. - Reinhard Zumkeller, May 01 2012
Number A(x) of a(n) not exceeding x equals 1 + pi(x) + pi(x/2) + pi(x/4) + ..., where pi(x) is the number of primes <= x. If x goes to infinity, A(x)~2*x/log(x) and a(n)~n*log(n)/2 (n-->infinity). - Vladimir Shevelev, Feb 06 2014

A093642 Numbers not containing all divisors in their binary representation.

Original entry on oeis.org

9, 15, 18, 21, 25, 27, 30, 33, 35, 36, 39, 42, 45, 49, 50, 51, 54, 57, 60, 63, 65, 66, 69, 70, 72, 75, 77, 78, 81, 84, 85, 87, 90, 91, 93, 95, 98, 99, 100, 102, 105, 108, 110, 111, 114, 115, 117, 119, 120, 121, 123, 125, 126, 129, 130, 132, 133, 135, 138, 140, 141
Offset: 1

Author

Reinhard Zumkeller, Apr 07 2004

Keywords

Examples

			55 is not a member, as the binary representations of 5 ("101") and 11 ("1011") both appear in the binary representation of 55 ("110111").
		

Crossrefs

Complement of A123345.
Subsequence of A105441. - Reinhard Zumkeller, Apr 09 2005

Programs

  • Haskell
    import Data.List (unfoldr, isInfixOf)
    a093642 n = a093642_list !! (n-1)
    a093642_list = filter
      (\x -> not $ all (`isInfixOf` b x) $ map b $ a027750_row x) [1..] where
      b = unfoldr (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2)
    -- Reinhard Zumkeller, Oct 27 2012
    
  • Mathematica
    q[n_] := !AllTrue[Divisors[n], StringContainsQ[IntegerString[n, 2], IntegerString[#, 2]] &]; Select[Range[150], q] (* Amiram Eldar, Jun 05 2022 *)
  • Python
    from sympy import divisors
    def ok(n):
        b = bin(n)[2:]
        return not all(bin(d)[2:] in b for d in divisors(n, generator=True))
    print([k for k in range(119) if ok(k)]) # Michael S. Branicky, Jun 05 2022

Formula

A093640(a(n)) < A000005(a(n)).

A355633 a(n) is the sum of the divisors of n whose binary expansions appear as substrings in the binary expansion of n.

Original entry on oeis.org

1, 3, 4, 7, 6, 12, 8, 15, 10, 18, 12, 28, 14, 24, 19, 31, 18, 30, 20, 42, 22, 36, 24, 60, 26, 42, 31, 56, 30, 57, 32, 63, 34, 54, 36, 70, 38, 60, 43, 90, 42, 66, 44, 84, 54, 72, 48, 124, 50, 78, 55, 98, 54, 93, 72, 120, 61, 90, 60, 133, 62, 96, 74, 127, 66
Offset: 1

Author

Rémy Sigrist, Jul 11 2022

Keywords

Examples

			For n = 84:
- the binary expansion of 84 is "1010100",
- we have the following divisors:
  d   bin(d)   in bin(84)?
  --  -------  -----------
   1        1  Yes
   2       10  Yes
   3       11  No
   4      100  Yes
   6      110  No
   7      111  No
  12     1100  No
  14     1110  No
  21    10101  Yes
  28    11100  No
  42   101010  Yes
  84  1010100  Yes
- so a(84) = 1 + 2 + 4 + 21 + 42 + 84 = 154.
		

Crossrefs

Cf. A000203, A027750, A093640, A355620 (decimal analog), A355634.

Programs

  • Mathematica
    a[n_] := DivisorSum[n, # &, StringContainsQ @@ IntegerString[{n, #}, 2] &]; Array[a, 100] (* Amiram Eldar, Jul 16 2022 *)
  • PARI
    a(n, base=2) = { my (d=digits(n, base), s=setbinop((i, j) -> fromdigits(d[i..j], base), [1..#d]), v=0); for (k=1, #s, if (s[k] && n%s[k]==0, v+=s[k])); return (v) }
    
  • Python
    from sympy import divisors
    def a(n):
        s = bin(n)[2:]
        return sum(d for d in divisors(n, generator=True) if bin(d)[2:] in s)
    print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Jul 11 2022

Formula

a(n) <= A000203(n).
a(2^n) = 2^(n+1) - 1 for any n >= 0.

A320538 Assuming the truth of the Collatz conjecture, a(n) is the number of divisors of n appearing in the Collatz trajectory of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 2, 4, 2, 6, 2, 4, 3, 5, 2, 4, 2, 6, 2, 4, 2, 8, 3, 4, 2, 6, 2, 6, 2, 6, 3, 4, 3, 6, 2, 4, 3, 8, 2, 4, 2, 6, 3, 4, 2, 10, 3, 6, 3, 6, 2, 4, 3, 8, 2, 4, 2, 9, 2, 4, 2, 7, 4, 6, 2, 6, 2, 6, 2, 8, 2, 4, 2, 6, 3, 6, 2, 10, 2, 4, 2, 6, 2, 4, 2
Offset: 1

Author

Michel Lagneau, Oct 15 2018

Keywords

Comments

a(p) = 2 for p prime.
a((2^2k - 1)/3) = 2, k = 1, 2, ...
We observe that a(n) differs from A093640(n) for n = 25, 27, 33, 35, 45, 49, 50, 54, 55, 57, 63, 65, 66, 70, 75, 77, 85, ...
7 occurs only eighteen times among the first 65537 terms. - Antti Karttunen, May 18 2019

Examples

			a(6) = 4 because the Collatz trajectory 6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 contains 4 divisors of 6: 1, 2, 3 and 6.
		

Programs

  • Mathematica
    lst={}; coll[n_]:=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]; Do[AppendTo[lst,Length[Intersection[Divisors[n],coll[n]]]],{n,1,100}]; lst
  • PARI
    f(n) = if(n%2, 3*n+1, n/2);
    a(n) = {my(kn = n, nb = 1); while (n != 1, n = f(n); if ((kn % n) == 0, nb++);); nb;}
Showing 1-5 of 5 results.