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

A320674 Positive integers m with binary expansion (b_1, ..., b_k) (where k = A070939(m)) such that b_i = [m == 0 (mod prime(i))] for i = 1..k (where prime(i) denotes the i-th prime number and [] is an Iverson bracket).

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 4096, 5120, 6144, 8192, 10240, 12288, 16384, 20480, 24576, 32768, 40960, 49152, 65536, 81920, 98304, 131072, 163840, 196608
Offset: 1

Views

Author

Rémy Sigrist, Oct 19 2018

Keywords

Comments

In other words, the 1's in the binary representation of a term of this sequence encode the first prime divisors of this term.
All terms are even.
All even terms in A029747 belong to this sequence.
The term a(71) = 33554434 is the first one that does not belong to A029747.
See A320673 for similar sequences.

Examples

			The initial terms, alongside their binary representation and the prime divisors encoded therein, are:
  n   a(n)      bin(a(n))                   First prime divisors
  --  --------  --------------------------  --------------------
   1         2  10                          2
   2         4  100                         2
   3         6  110                         2, 3
   4         8  1000                        2
   5        10  1010                        2, 5
   6        12  1100                        2, 3
   7        16  10000                       2
   8        20  10100                       2, 5
   9        24  11000                       2, 3
  ...
  71  33554434  10000000000000000000000010  2, 97
  ...
33554434 is in the sequence because its binary expansion 10000000000000000000000010 of length 26 has a 1 in the 1st place and in the 25th place from the left and 0 elsewhere. As it is divisible by the 1st and 25th prime and by no other prime with index <= 26, 33554434 in the sequence. - _David A. Corneth_, Oct 20 2018
		

Crossrefs

Programs

  • Mathematica
    selQ[n_] := With[{bb = IntegerDigits[n, 2]}, (Prime /@ Flatten[Position[bb, 1]]) == FactorInteger[n][[All, 1]]];
    Select[Range[2, 200000], selQ] (* Jean-François Alcover, Nov 01 2018 *)
  • PARI
    is(n) = my (b=binary(n)); b==vector(#b, k, n%prime(k)==0)

A320675 Positive integers m with binary expansion (b_1, ..., b_k) (where k = A070939(m)) such that b_i = [gcd(m, i)=1] for i = 1..k (where [] is an Iverson bracket).

Original entry on oeis.org

1, 2, 3, 7, 10, 20, 27, 31, 40, 127, 138, 219, 245, 276, 552, 650, 682, 1364, 2047, 2728, 8191, 10922, 13515, 14043, 32747, 112347, 131071, 524287, 2796202, 3459945, 5592404, 7124187, 8388607, 8530050, 10660010, 11184808, 16645111, 17060100, 21320020, 33554431
Offset: 1

Views

Author

Rémy Sigrist, Oct 19 2018

Keywords

Comments

In other words, the ones in the binary representation of a term of this sequence encode the first numbers coprime to this term.
This sequence contains every term of A001348: 2^2 - 1 belongs to this sequence, and for any odd prime number p, if q divides 2^p - 1, then q > p and gcd(p, i) = 1 for i = 1..p.
See A320673 for similar sequences.

Examples

			The first terms, alongside their binary representation and the coprime numbers encoded therein, are:
  n   a(n)  bin(a(n))  First numbers coprime
  --  ----  ---------  ---------------------
   1     1  1          1
   2     2  10         1
   3     3  11         1, 2
   4     7  111        1, 2, 3
   5    10  1010       1, 3
   6    20  10100      1, 3
   7    27  11011      1, 2, 4, 5
   8    31  11111      1, 2, 3, 4, 5
   9    40  101000     1, 3
  10   127  1111111    1, 2, 3, 4, 5, 6, 7
		

Crossrefs

Programs

  • PARI
    is(n) = my (b=binary(n)); b==vector(#b, k, gcd(n, k)==1)

A358970 Nonnegative numbers m such that if 2^k appears in the binary expansion of m, then k+1 divides m.

Original entry on oeis.org

0, 1, 2, 6, 8, 12, 36, 60, 128, 136, 168, 261, 288, 520, 530, 540, 630, 640, 1056, 2052, 2088, 2100, 2184, 2208, 2304, 2340, 2520, 2580, 4134, 8232, 8400, 8820, 9240, 10248, 10920, 16440, 16560, 16920, 16950, 17010, 17040, 17190, 17280, 18480, 18600, 18720
Offset: 1

Views

Author

Rémy Sigrist, Dec 07 2022

Keywords

Comments

In other words, numbers whose binary expansion encodes a subset of their divisors.
Also numbers m divisible by A271410(m).
This sequence is infinite as it contains A058891.

Examples

			60 = 2^5 + 2^4 + 2^3 + 2^2 and 60 is divisible by 5+1, 4+1, 3+1 and 2+1, so 60 belongs to the sequence.
42 = 2^5 + 2^3 + 2^1 and 42 is not divisible by 3+1, so 42 does not belong to the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[20000], Function[n, AllTrue[Position[Reverse@ IntegerDigits[n, 2], 1][[All, 1]], Divisible[n, #] &]]] (* Michael De Vlieger, Dec 12 2022 *)
  • PARI
    is(n) = { my (r=n, k); while (r, r-=2^k=valuation(r,2); if (n%(k+1), return (0););); return (1); }
    
  • Python
    def ok(n): return all(n%(k+1) == 0 or not n&(1<Michael S. Branicky, Dec 07 2022
    
  • Python
    from itertools import count, islice
    def A358970_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:not any(n%i for i,b in enumerate(bin(n)[:1:-1],1) if b=='1'),count(max(startvalue,0)))
    A358970_list = list(islice(A358970_gen(),20)) # Chai Wah Wu, Dec 12 2022
Showing 1-3 of 3 results.