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

A048490 a(n) = T(7,n), array T given by A048483.

Original entry on oeis.org

1, 9, 25, 57, 121, 249, 505, 1017, 2041, 4089, 8185, 16377, 32761, 65529, 131065, 262137, 524281, 1048569, 2097145, 4194297, 8388601, 16777209, 33554425, 67108857, 134217721, 268435449, 536870905, 1073741817, 2147483641, 4294967289, 8589934585
Offset: 0

Views

Author

Keywords

Comments

n-th difference of a(n), a(n-1), ..., a(0) is (8, 8, 8, ...).

Programs

Formula

a(n) = 8 * 2^n - 7. - Ralf Stephan, Jan 09 2009
Equals binomial transform of [1, 8, 8, 8, ...]. - Gary W. Adamson, Apr 29 2008
a(n) = 2*a(n-1) + 7 for n > 0, a(0)=1. - Vincenzo Librandi, Aug 06 2010
For n>=1, a(n) = 6<+>(n+3), where the operation <+> is defined in A206853. - Vladimir Shevelev, Feb 17 2012
From Colin Barker, Nov 26 2014: (Start)
a(n) = 3*a(n-1) - 2*a(n-2).
G.f.: (6*x+1) / ((x-1)*(2*x-1)). (End)

Extensions

More terms from Colin Barker, Nov 26 2014

A207063 a(n) is the smallest number larger than a(n-1) with mutual Hamming distance 2 and a(1)=0.

Original entry on oeis.org

0, 3, 5, 6, 10, 12, 15, 23, 27, 29, 30, 46, 54, 58, 60, 63, 95, 111, 119, 123, 125, 126, 190, 222, 238, 246, 250, 252, 255, 383, 447, 479, 495, 503, 507, 509, 510, 766, 894, 958, 990, 1006, 1014, 1018, 1020, 1023, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043
Offset: 1

Views

Author

Alois P. Heinz, Feb 14 2012

Keywords

Comments

The binary expansion of a(n) has an even number of 1's. So this is a subsequence of A001969. The odd analog is A206853.
This sequence has 4*k+1 = A016813(k) numbers with exactly 2*k 1's and no number with more than two 0's in their binary expansion.

Examples

			| n | a(n) | A007088(a(n))| A000120(a(n))|
+---+------+--------------+--------------+
| 1 |   0  |         0    |       0      |
| 2 |   3  |        11    |       2      |
| 3 |   5  |       101    |       2      |
| 4 |   6  |       110    |       2      |
| 5 |  10  |      1010    |       2      |
| 6 |  12  |      1100    |       2      |
| 7 |  15  |      1111    |       4      |
| 8 |  23  |     10111    |       4      |
		

Crossrefs

Cf. A182187 (next with Hamming distance 2), A206853 (iterate from 1).

Programs

  • Maple
    g:= proc(n) option remember; local l; l:= g(n-1);
          `if`(nops(l)=1, [l[1]+1, l[1]-1], `if`(nops(l)=2,
          `if`(l[2]<>0, [l[1], l[2]-1], [l[1]+1, 0, l[1]-1]),
          `if`(l[3]<>1, [l[1], l[2], l[3]-1], [l[1]])))
        end: g(1):= [2, 0, 1]:
    a:= n-> (l-> 2^l[1]-1 -add(2^l[i], i=2..nops(l)))(g(n)):
    seq(a(n), n=1..300);
  • Python
    def aupton(terms):
        alst = [0]
        for n in range(2, terms+1):
            an = alst[-1] + 1
            while bin(an^alst[-1]).count('1') != 2:  an += 1
            alst.append(an)
        return alst
    print(aupton(54)) # Michael S. Branicky, Jul 07 2021

A182209 a(n) is the least m >= n, such that the Hamming distance D(n,m) = 3.

Original entry on oeis.org

7, 6, 5, 4, 9, 8, 8, 9, 15, 14, 13, 12, 16, 17, 18, 19, 23, 22, 21, 20, 25, 24, 24, 25, 31, 30, 29, 28, 36, 37, 38, 39, 39, 38, 37, 36, 41, 40, 40, 41, 47, 46, 45, 44, 48, 49, 50, 51, 55, 54, 53, 52, 57, 56, 56, 57, 63, 62, 61, 60, 76, 77, 78, 79, 71, 70, 69
Offset: 0

Views

Author

Vladimir Shevelev, Apr 18 2012

Keywords

Comments

a(n) = n<+>3 (see comment in A206853).

Crossrefs

Cf. A086799 ((n-1)<+>1), A182187 (n<+>2), A182336 (n<+>4).
Cf. A209554 (primes which are not terms nor n<+>2 terms).

Programs

  • Maple
    HD:= (i, j)-> add(h, h=Bits[Split](Bits[Xor](i, j))):
    a:= proc(n) local c;
          for c from n do if HD(n, c)=3 then return c fi od
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Apr 18 2012
  • PARI
    a(n) = bitxor(n, if(bitand(n,14)==4, 13, 7<>2+1,2))); \\ Kevin Ryde, Jul 10 2021
  • Python
    def d(n, m): return bin(n^m).count('1')
    def a(n):
        m = n+1
        while d(n, m) != 3: m += 1
        return m
    print([a(n) for n in range(67)]) # Michael S. Branicky, Jul 06 2021
    

Formula

If n==i mod 8, then a(n) = n-2*i+7, i=0,1,2,3; if n==4 mod 16, then a(n) = n+5; if n==12 mod 16, then a(n) = n+2^(A007814(n+4)-2); if n==5 mod 16, then a(n) = n+3; if n==13 mod 16, then a(n) = n+2^(A007814(n+3)-2); if n==6 mod 8, then a(n) = n+2^(A007814(n+2)-2); if n==7 mod 8, then a(n) = n+2^(A007814(n+1)-2).
Using this formula, we can prove conjecture formulated in comment in A209554 in case k=3. Moreover, one can prove that N could be represented in form n<+>2 or n<+>3 iff N is not a number of the forms 32*t, 32*t+1. - Vladimir Shevelev, Apr 25 2012

A207016 a(1) = 3 , for n > 1 a(n) is the least number greater than a(n-1) such that the Hamming distance D(a(n-1),a(n)) = 3.

Original entry on oeis.org

3, 4, 9, 14, 18, 21, 24, 31, 39, 41, 46, 50, 53, 56, 63, 79, 83, 84, 89, 94, 102, 104, 111, 115, 116, 121, 126, 158, 166, 168, 175, 179, 180, 185, 190, 206, 210, 213, 216, 223, 231, 233, 238, 242, 245, 248, 255, 319, 335, 339, 340, 345, 350, 358, 360, 367, 371
Offset: 1

Views

Author

Vladimir Shevelev, Feb 14 2012

Keywords

Comments

Odious and evil terms are alternating (cf. A000069, A001969).

Crossrefs

Programs

  • Mathematica
    a[1] = 3; a[n_] := a[n] = Module[{k = a[n - 1], m = a[n-1] + 1}, While[DigitCount[BitXor[k, m], 2, 1] != 3, m++]; m]; Array[a, 100] (* Amiram Eldar, Aug 06 2023 *)
  • PARI
    list(n)=my(v=vector(n));v[1]=3;for(i=2,n,v[i]=v[i-1]; while(hammingweight(bitxor(v[i-1],v[i]++))!=3,));v \\ Charles R Greathouse IV, Mar 26 2013

A208982 Numbers n such that the next larger number with mutual Hamming distance 1 is prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 16, 17, 18, 19, 21, 22, 23, 27, 28, 29, 30, 36, 39, 40, 41, 42, 43, 45, 46, 52, 57, 58, 60, 63, 65, 66, 67, 69, 70, 71, 72, 75, 77, 78, 81, 82, 88, 95, 96, 99, 100, 101, 102, 105, 106, 108, 111, 112, 119, 123, 125, 126, 129, 130, 136, 137, 138, 147, 148, 149, 150
Offset: 1

Views

Author

Vladimir Shevelev, Mar 04 2012

Keywords

Comments

If p is prime, then p-1 is in the sequence.
Using the prime number theorem in arithmetic progressions k*n+b with gcd(k,b)=1 and its uniformity over k<=exp(c*sqrt(log(x))), one can prove that the counting function of a(n)<=x is equivalent to 2*x/log(x), as x tends to infinity.

Crossrefs

Programs

  • PARI
    isok(n) = my(nextn = n+1); while (hammingweight(bitxor(n, nextn)) != 1, nextn++); isprime(nextn); \\ Michel Marcus, Jul 01 2014

A182336 a(n) is the least m>=n, such that the Hamming distance D(n,m)=4.

Original entry on oeis.org

15, 14, 13, 12, 11, 10, 9, 8, 19, 18, 17, 16, 17, 16, 16, 17, 31, 30, 29, 28, 27, 26, 25, 24, 33, 32, 32, 33, 32, 33, 34, 35, 47, 46, 45, 44, 43, 42, 41, 40, 51, 50, 49, 48, 49, 48, 48, 49, 63, 62, 61, 60, 59, 58, 57, 56, 64, 65, 66, 67, 68, 69, 70, 71, 79, 78, 77, 76, 75, 74
Offset: 0

Views

Author

Vladimir Shevelev, Apr 25 2012

Keywords

Comments

Or (see comment in A206853) a(n)=n<+>4.
Conjecture: for n > 96, n + 1 <= a(n) <= 9n/8 + 1. - Charles R Greathouse IV, Apr 25 2012

Crossrefs

Programs

  • PARI
    hamming(n)=my(v=binary(n));sum(i=1,#v,v[i])
    a(n)=my(k=n);while(hamming(bitxor(n,k++))!=4,);k \\ Charles R Greathouse IV, Apr 25 2012

Extensions

Terms corrected by Charles R Greathouse IV, Apr 25 2012

A209085 a(n) is the next larger than A208982(n) number with mutual Hamming distance 1.

Original entry on oeis.org

3, 3, 7, 5, 7, 7, 11, 11, 13, 31, 17, 19, 19, 23, 23, 23, 31, 31, 29, 31, 31, 37, 47, 41, 43, 43, 47, 47, 47, 53, 59, 59, 61, 127, 67, 67, 71, 71, 71, 79, 73, 79, 79, 79, 83, 83, 89, 127, 97, 103, 101, 103, 103, 107, 107, 109, 127, 113, 127, 127, 127, 127
Offset: 1

Views

Author

Vladimir Shevelev, Mar 05 2012

Keywords

Comments

All terms are prime by construction of A208982, and prime p occurs k times iff 2^k||p+1. In particular, every prime of the form 4*k+1 occurs 1 time. Thus all odd primes are in the sequence.

Examples

			Since 2^4 divides 48, but 2^5 not divides, i.e., 2^4||48, then 47 occurs four times.
		

Crossrefs

A172252 a(n) = 4*2^n - 9.

Original entry on oeis.org

-1, 7, 23, 55, 119, 247, 503, 1015, 2039, 4087, 8183, 16375, 32759, 65527, 131063, 262135, 524279, 1048567, 2097143, 4194295, 8388599, 16777207, 33554423, 67108855, 134217719, 268435447, 536870903, 1073741815, 2147483639, 4294967287, 8589934583, 17179869175, 34359738359
Offset: 1

Views

Author

Artur Jasinski, Jan 29 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Table[4 2^n - 9, {n, 1, 100}]
    LinearRecurrence[{3,-2},{-1,7},30] (* Harvey P. Dale, May 27 2021 *)
  • PARI
    my(x='x+O('x^34)); Vec(x*(10*x-1)/((x-1)*(2*x-1))) \\ Elmo R. Oliveira, Jun 15 2025

Formula

a(n) = 2*a(n-1) + 9, a(1)= -1. - Vincenzo Librandi, Mar 20 2011
For n >= 3, a(n) = 8<+>(n+2), where operation <+> is defined in A206853. - Vladimir Shevelev, Feb 17 2012
From Elmo R. Oliveira, Jun 15 2025: (Start)
G.f.: x*(10*x-1)/((x-1)*(2*x-1)).
E.g.f.: 5 + exp(x)*(4*exp(x) - 9).
a(n) = A185346(n+2) = 4*A000225(n) - 5.
a(n) = A159741(n-1) - 1 for n > 1. (End)

Extensions

More terms from Elmo R. Oliveira, Jun 15 2025

A207460 Let a(1) = 4. For n > 1, a(n) is the least number greater than a(n-1) such that the Hamming distance D(a(n-1),a(n)) = 4.

Original entry on oeis.org

4, 11, 16, 31, 35, 44, 49, 62, 70, 73, 82, 93, 97, 110, 112, 127, 143, 145, 158, 162, 173, 176, 191, 199, 200, 211, 220, 224, 239, 241, 254, 286, 290, 301, 304, 319, 327, 328, 339, 348, 352, 367, 369, 382, 398, 400, 415, 419
Offset: 1

Views

Author

Vladimir Shevelev, Feb 18 2012

Keywords

Comments

All terms are odious (A000069).

Crossrefs

Programs

  • Mathematica
    nxt[n_]:=Module[{k=n+1},While[HammingDistance[PadLeft[IntegerDigits[ n,2],IntegerLength[ k,2]],IntegerDigits[k,2]]!=4,k++];k]; NestList[ nxt,4,50] (* Harvey P. Dale, Nov 07 2020 *)

A207472 Let a(1) = 5. For n > 1, a(n) is the least number greater than a(n-1) such that the Hamming distance D(a(n-1),a(n)) = 5.

Original entry on oeis.org

5, 26, 33, 62, 66, 93, 96, 127, 135, 152, 163, 188, 192, 223, 225, 254, 270, 273, 294, 313, 320, 351, 353, 382, 390, 409, 418, 445, 449, 478, 480, 511, 543, 545, 574, 578, 605, 608, 639, 647, 664, 675, 700, 704, 735, 737, 766, 782, 785, 806, 825, 832, 863, 865
Offset: 1

Views

Author

Vladimir Shevelev, Feb 18 2012

Keywords

Comments

Odious and evil terms are alternating (cf. A000069, A001969).

Crossrefs

Programs

  • Mathematica
    a[1] = 5; a[n_] := a[n] = Module[{k = a[n - 1], m = a[n-1] + 1}, While[DigitCount[BitXor[k, m], 2, 1] != 5, m++]; m]; Array[a, 100] (* Amiram Eldar, Aug 06 2023 *)
Previous Showing 11-20 of 20 results.