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.

Previous Showing 11-16 of 16 results.

A064894 Binary dilution of n. GCD of exponents in binary expansion of n.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Marc LeBrun, Oct 11 2001

Keywords

Comments

All bits of n in positions not divisible by a(n) are zero. Hence n in binary contains blocks of a(n)-1 "diluting" 0's (for n>1). Also for n>1, a(2^n) = a(2^n + 1) = n. For i,j odd, a(ij) = GCD(a(i),a(j)).

Examples

			577 = 2^0 + 2^6 + 2^9, GCD(0,6,9) = 3 = a(577).
		

Crossrefs

Programs

  • Mathematica
    A064894[n_] := Apply[GCD, Flatten[Position[Reverse[IntegerDigits[n, 2]], 1]] - 1];
    Array[A064894, 100, 0] (* Paolo Xausa, Feb 13 2024 *)
  • PARI
    a(n) = if (n==0, 0, my(ve = select(x->x==1, Vecrev(binary(n)), 1)); gcd(vector(#ve, k, ve[k]-1))); \\ Michel Marcus, Apr 12 2016

Formula

If n = 2^e0 + 2^e1 +... then a(n) = GCD(e0, e1, ...).
a(A064896(n)) = A056538(n)

A124241 Terms of A068563 that are not terms of A124240.

Original entry on oeis.org

136, 408, 620, 680, 820, 1224, 1240, 1314, 2040, 2312, 2460, 2480, 2628, 2856, 3100, 3400, 3672, 3924, 3942, 4100, 4112, 4656, 4960, 5304, 5334, 5784, 6120, 6200, 6820, 6936, 7380, 7480, 7848, 7884, 8224, 8568, 9020, 9060, 9198, 9492, 9920, 10200, 10668, 11016, 11560, 11568, 11826, 12300, 12336, 12400, 13140, 13640
Offset: 1

Views

Author

Alexander Adamchuk, Oct 22 2006, Oct 27 2006

Keywords

Comments

A068563 contains A124240 as a subsequence. This sequence gives their set difference.
Note that a(2) = 3*a(1) and a(4) = 5*a(1). a(6) = 1224 = 9*a(1), a(7) = 1240 = 2*a(3), a(8) = 1314, a(9) = 2040 = 15*a(1), a(10) = 2312 = 17*a(1), a(11) = 2460 = 3*a(5), a(12)= 2480 = 4*a(3), a(13) = 2856 = 21*a(1). Numbers k such that there exists a(n) = k*a(1) are k = {1, 3, 5, 9, 15, 17, 21, ...}.
Many but not all terms belong to A124276.

Crossrefs

Programs

  • PARI
    for(n=1,10^5, m=n\2^valuation(n,2); if( Mod(n,znorder(Mod(2,m))), next); p=factor(n)[,1]; g=1; for(i=1,#p, if( Mod(n,p[i]-1), g=0; break) ); if(g,next); print1(n,", ") ) /* Alekseyev */

Extensions

a(13) corrected and terms a(14) onward provided by Max Alekseyev, Aug 25 2013

A140797 Numbers of the form (2^p^N-1)/(2^p^(N-1)-1), where N>0, p is prime.

Original entry on oeis.org

3, 5, 7, 17, 31, 73, 127, 257, 2047, 8191, 65537, 131071, 262657, 524287, 1082401, 8388607, 536870911, 2147483647, 4294967297, 137438953471, 2199023255551, 4432676798593, 8796093022207, 140737488355327, 9007199254740991, 18014398643699713, 576460752303423487
Offset: 1

Views

Author

Vladimir Shevelev, Jul 15 2008

Keywords

Comments

Contains Fermat numbers A000215 (p=2) and Mersenne numbers A001348 (N=1). The terms of the sequence are either primes A000040 or overpseudoprimes A141232.
The values of A019320(n) for prime power n, sorted. This sequence is a subsequence of A064896, which means that all terms are sturdy numbers (A125121). It appears that the largest prime factor of each of these numbers is a sturdy prime (A143027). - T. D. Noe, Jul 21 2008

Crossrefs

Programs

  • Mathematica
    nmax[p_] := Which[p == 2, 6, p == 3, 4, True, 2];
    Reap[Do[If[IntegerQ[k = (2^p^n-1)/(2^p^(n-1)-1)] && k<10^18, Print[{p, n, k}]; Sow[k]], {p, Prime[Range[17]]}, {n, 1, nmax[p]}]][[2, 1]] // Union (* Jean-François Alcover, Dec 10 2018 *)

Extensions

Definition corrected by and more terms from T. D. Noe, Jul 21 2008

A370425 Integers of the form (2^x + 1) / (2^y + 1).

Original entry on oeis.org

1, 3, 11, 13, 43, 57, 171, 205, 241, 683, 993, 2731, 3277, 3641, 4033, 10923, 16257, 43691, 52429, 61681, 65281, 174763, 233017, 261633, 699051, 838861, 1016801, 1047553, 2796203, 4192257, 11184811, 13421773, 14913081, 15790321, 16519105, 16773121, 44739243, 67100673, 178956971
Offset: 1

Views

Author

Thomas Ordowski, Feb 16 2024

Keywords

Comments

The integers k for which the equation 2^x - k = k*2^y - 1 has a solution x,y > 0.
If x,y > 0, then 2^y + 1 divides 2^x + 1 if and only if x/y is odd.
The prime numbers of this sequence are A281728.

Examples

			(2^5+1)/(2^1+1) = 11 = 1011,
(2^10+1)/(2^2+1) = 205 = 11001101,
(2^15+1)/(2^3+1) = 3641 = 111000111001,
(2^20+1)/(2^4+1) = 61681 = 1111000011110001,
(2^25+1)/(2^5+1) = 1016801 = 11111000001111100001,
(2^30+1)/(2^6+1) = 16519105 = 111111000000111111000001,
(2^35+1)/(2^7+1) = 266354561 = 1111111000000011111110000001, ...
Note that all the above examples are A020518(n) for n > 0.
		

Crossrefs

Cf. A064896 (integers of the form (2^x-1)/(2^y-1)), A079665, A281728.

Programs

  • PARI
    get_xy(m) = my(x, y, t); y=valuation(m-1, 2); t=m*(2^y+1)-1; if(t!=2^(x=valuation(t, 2)), [], [x, y]); \\ Max Alekseyev, Feb 18 2024

Extensions

More terms from Michel Marcus, Feb 17 2024

A330220 Numbers whose representation in base 2^w contains only the digit 2^k for some w and k such that 0 <= k < w.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 21, 31, 32, 33, 34, 36, 42, 63, 64, 65, 66, 68, 73, 85, 127, 128, 129, 130, 132, 136, 146, 170, 255, 256, 257, 258, 260, 264, 273, 292, 341, 511, 512, 513, 514, 516, 520, 528, 546, 585, 682, 1023, 1024, 1025, 1026
Offset: 1

Views

Author

Rémy Sigrist, Dec 06 2019

Keywords

Comments

This is a subsequence of A295235.
For any k > 0, there are k nonzero terms with k binary digits.
Odd terms are A064896.

Examples

			The representation of 546 in base 2^4 is "222", so 546 belongs to the sequence.
		

Crossrefs

Programs

  • PARI
    is(n) = { for (w=1, max(1, #binary(n)), my (d=if (n, digits(n,2^w), [0])); if (#Set(d)==1 && hammingweight(d[1])<=1, return (1))); return (0) }

A348363 The 1's in the binary expansion of a(n) encode the distances between the 1's in the binary expansion of n.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 15, 3, 15, 7, 15, 1, 17, 9, 27, 5, 21, 15, 31, 3, 27, 15, 31, 7, 31, 15, 31, 1, 33, 17, 51, 9, 45, 27, 63, 5, 45, 21, 63, 15, 47, 31, 63, 3, 51, 27, 59, 15, 63, 31, 63, 7, 63, 31, 63, 15, 63, 31, 63, 1, 65, 33, 99, 17, 85, 51
Offset: 0

Views

Author

Rémy Sigrist, Oct 15 2021

Keywords

Comments

The bit 2^d is set in a(n) iff for some e >= 0, the bits 2^e and 2^(e+d) are set in n.
This sequence has similarities with A067398; here we take the absolute differences, there the sums, of indices of 1's in binary expansions.
All terms are odd, except a(0) = 0.

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1      10          1
   3     3      11         11
   4     1     100          1
   5     5     101        101
   6     3     110         11
   7     7     111        111
   8     1    1000          1
   9     9    1001       1001
  10     5    1010        101
  11    15    1011       1111
  12     3    1100         11
  13    15    1101       1111
  14     7    1110        111
  15    15    1111       1111
		

Crossrefs

Programs

  • Mathematica
    {0}~Join~Array[Total[2^Append[Union@ Abs[Subtract @@@ Permutations[1 + Length[#] - Position[#, 1][[All, 1]] &@ IntegerDigits[#, 2], {2}]], 0]] &, 70] (* Michael De Vlieger, Oct 16 2021 *)
  • PARI
    a(n) = { my (b=vector(hammingweight(n))); for (k=1, #b, n-=2^b[k]=valuation(n, 2);); my (p=setbinop((i,j)->abs(i-j), b)); sum (k=1, #p, 2^p[k]) }
    
  • Python
    def a(n):
        locs = [e for e in range(n.bit_length()) if 1 & (n>>e)]
        diffs = set(abs(e1-e2) for i, e1 in enumerate(locs) for e2 in locs[i:])
        return sum(2**d for d in diffs)
    print([a(n) for n in range(71)]) # Michael S. Branicky, Oct 16 2021

Formula

a(2*n) = a(n).
a(n) = n iff n = 0 or n belongs to A064896.
a(n) = 1 iff n is a power of 2 (A000079).
a(n) = 3 iff n belongs to A007283.
a(n) = 5 iff n belongs to A020714.
a(n) AND n = n for any odd number n (where AND denotes the bitwise AND operator).
Previous Showing 11-16 of 16 results.