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-10 of 15 results. Next

A048730 Differences between A008589 (multiples of 7) and A048727, a(n) = ((n*7)-Xmult(n,7)).

Original entry on oeis.org

0, 0, 0, 12, 0, 8, 24, 28, 0, 0, 16, 28, 48, 56, 56, 60, 0, 0, 0, 12, 32, 40, 56, 60, 96, 96, 112, 124, 112, 120, 120, 124, 0, 0, 0, 12, 0, 8, 24, 28, 64, 64, 80, 92, 112, 120, 120, 124, 192, 192, 192, 204, 224, 232, 248
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

For n = binary n[k],n[k-1],...,n[0], bits a(n) = binary b[k+1],b[k],...,b[0] are b[i] = 1 when n[i-1] + n[i-2] + n[i-3] >= 2, so the majority bit 0 or 1 among the 3 bits of n below position i (with 0 bits below the radix point of n as necessary). This is since 7*n = 4*n + 2*n + n is n[i-1] + n[i-2] + n[i-3] at position i-1, and 4*n XOR 2*n XOR n is the same but no carry, so b[i] is the carry only. - Kevin Ryde, Mar 26 2021

Crossrefs

Positions of zeros are given by A048715. Cf. A048733, A342697.
Diagonal 7 of A061858.

Programs

A284557 a(n) = A048727(n) mod 3.

Original entry on oeis.org

0, 1, 2, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 2, 0, 0, 1, 2, 0, 1, 0, 2, 2, 2, 0, 1, 1, 2, 0, 2, 0, 0, 2, 0, 1, 2, 0, 2, 2, 2, 0, 1, 1, 2, 1, 0, 1, 1, 0, 1, 2, 0, 2, 1, 1, 1, 0, 1, 1, 2, 0, 2, 0, 0, 1, 2, 0, 1, 2, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 0, 1, 2, 0, 2, 1, 1, 1, 2, 0, 0, 1, 2, 1, 2, 2, 0, 1, 2, 0, 1, 0, 0, 0, 1, 2, 2, 0, 2, 1, 2, 2, 0, 1, 2, 0, 2, 1, 1, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Apr 10 2017

Keywords

Crossrefs

Row 3 of array A284270 (after the initial zero).
Cf. A048727, A284555 (positions of zeros), A284574, A284575.

Programs

Formula

a(n) = A048727(n) mod 3.

A048720 Multiplication table {0..i} X {0..j} of binary polynomials (polynomials over GF(2)) interpreted as binary vectors, then written in base 10; or, binary multiplication without carries.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 4, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 5, 8, 5, 0, 0, 6, 10, 12, 12, 10, 6, 0, 0, 7, 12, 15, 16, 15, 12, 7, 0, 0, 8, 14, 10, 20, 20, 10, 14, 8, 0, 0, 9, 16, 9, 24, 17, 24, 9, 16, 9, 0, 0, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 0, 0, 11, 20, 27, 32, 27, 20, 27, 32, 27, 20, 11, 0
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

Essentially same as A091257 but computed starting from offset 0 instead of 1.
Each polynomial in GF(2)[X] is encoded as the number whose binary representation is given by the coefficients of the polynomial, e.g., 13 = 2^3 + 2^2 + 2^0 = 1101_2 encodes 1*X^3 + 1*X^2 + 0*X^1 + 1*X^0 = X^3 + X^2 + X^0. - Antti Karttunen and Peter Munn, Jan 22 2021
To listen to this sequence, I find instrument 99 (crystal) works well with the other parameters defaulted. - Peter Munn, Nov 01 2022

Examples

			Top left corner of array:
  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 ...
  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
  0  2  4  6  8 10 12 14 16 18 20 22 24 26 28 30 ...
  0  3  6  5 12 15 10  9 24 27 30 29 20 23 18 17 ...
  ...
From _Antti Karttunen_ and _Peter Munn_, Jan 23 2021: (Start)
Multiplying 10 (= 1010_2) and 11 (= 1011_2), in binary results in:
     1011
  *  1010
  -------
   c1011
  1011
  -------
  1101110  (110 in decimal),
and we see that there is a carry-bit (marked c) affecting the result.
In carryless binary multiplication, the second part of the process (in which the intermediate results are summed) looks like this:
    1011
  1011
  -------
  1001110  (78 in decimal).
(End)
		

Crossrefs

Cf. A051776 (Nim-product), A091257 (subtable).
Carryless multiplication in other bases: A325820 (3), A059692 (10).
Ordinary {0..i} * {0..j} multiplication table: A004247 and its differences from this: A061858 (which lists further sequences related to presence/absence of carry in binary multiplication).
Carryless product of the prime factors of n: A234741.
Binary irreducible polynomials ("X-primes"): A014580, factorization table: A256170, table of "X-powers": A048723, powers of 3: A001317, rearranged subtable with distinct terms (comparable to A054582): A277820.
See A014580 for further sequences related to the difference between factorization into GF(2)[X] irreducibles and ordinary prime factorization of the integer encoding.
Row/column 3: A048724 (even bisection of A003188), 5: A048725, 6: A048726, 7: A048727; main diagonal: A000695.
Associated additive operation: A003987.
Equivalent sequences, as compared with standard integer multiplication: A048631 (factorials), A091242 (composites), A091255 (gcd), A091256 (lcm), A280500 (division).
See A091202 (and its variants) and A278233 for maps from/to ordinary multiplication.
See A115871, A115872 and A277320 for tables related to cross-domain congruences.

Programs

  • Maple
    trinv := n -> floor((1+sqrt(1+8*n))/2); # Gives integral inverses of the triangular numbers
    # Binary multiplication of nn and mm, but without carries (use XOR instead of ADD):
    Xmult := proc(nn,mm) local n,m,s; n := nn; m := mm; s := 0; while (n > 0) do if(1 = (n mod 2)) then s := XORnos(s,m); fi; n := floor(n/2); # Shift n right one bit. m := m*2; # Shift m left one bit. od; RETURN(s); end;
  • Mathematica
    trinv[n_] := Floor[(1 + Sqrt[1 + 8*n])/2];
    Xmult[nn_, mm_] := Module[{n = nn, m = mm, s = 0}, While[n > 0, If[1 == Mod[n, 2], s = BitXor[s, m]]; n = Floor[n/2]; m = m*2]; Return[s]];
    a[n_] := Xmult[(trinv[n] - 1)*((1/2)*trinv[n] + 1) - n, n - (trinv[n]*(trinv[n] - 1))/2];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Mar 16 2015, updated Mar 06 2016 after Maple *)
  • PARI
    up_to = 104;
    A048720sq(b,c) = fromdigits(Vec(Pol(binary(b))*Pol(binary(c)))%2, 2);
    A048720list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0, oo, for(col=0, a, i++; if(i > up_to, return(v)); v[i] = A048720sq(col, a-col))); (v); };
    v048720 = A048720list(up_to);
    A048720(n) = v048720[1+n]; \\ Antti Karttunen, Feb 15 2021

Formula

a(n) = Xmult( (((trinv(n)-1)*(((1/2)*trinv(n))+1))-n), (n-((trinv(n)*(trinv(n)-1))/2)) );
T(2b, c)=T(c, 2b)=T(b, 2c)=2T(b, c); T(2b+1, c)=T(c, 2b+1)=2T(b, c) XOR c - Henry Bottomley, Mar 16 2001
For n >= 0, A003188(2n) = T(n, 3); A003188(2n+1) = T(n, 3) XOR 1, where XOR is the bitwise exclusive-or operator, A003987. - Peter Munn, Feb 11 2021

A269160 Formula for Wolfram's Rule 30 cellular automaton: a(n) = n XOR (2n OR 4n).

Original entry on oeis.org

0, 7, 14, 13, 28, 27, 26, 25, 56, 63, 54, 53, 52, 51, 50, 49, 112, 119, 126, 125, 108, 107, 106, 105, 104, 111, 102, 101, 100, 99, 98, 97, 224, 231, 238, 237, 252, 251, 250, 249, 216, 223, 214, 213, 212, 211, 210, 209, 208, 215, 222, 221, 204, 203, 202, 201, 200, 207, 198, 197, 196, 195, 194, 193, 448, 455, 462
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2016

Keywords

Comments

Take n, write it in binary, see what Rule 30 would do to that state, convert it to decimal: that is a(n). For example, we can see in A110240 that 7 = 111_2 becomes 25 = 11001_2 under Rule 30, which is shown here by a(7) = 25. - N. J. A. Sloane, Nov 25 2016
The sequence is injective: no value occurs more than once.
Fibbinary numbers (A003714) give all integers n>=0 for which a(n) = A048727(n) and for which a(n) = A269161(n).

Crossrefs

Cf. A110240 (iterates starting from 1).
Cf. A269162 (left inverse).
Cf. A269163 (same sequence sorted into ascending order).
Cf. A269164 (values missing from this sequence).
Cf. also A048727, A269161.

Programs

Formula

a(n) = n XOR (2n OR 4n) = A003987(n, A003986(2*n, 4*n)).
Other identities. For all n >= 0:
a(2*n) = 2*a(n).
a(n) = A057889(A269161(A057889(n))). [Rule 30 is the mirror image of rule 86.]
A269162(a(n)) = n.
For all n >= 1:
A070939(a(n)) - A070939(n) = 2. [The binary length of a(n) is two bits longer than that of n for all nonzero values.]
G.f.: (3*x + 2*x^2 +x^3)/(1 - x^4) + Sum_{k>=1}(2^(k + 1)*x^(2^(k - 1))/((1 + x^(2^(k + 1)))*(1 - x))). - Miles Wilson, Jan 24 2025

A048725 a(n) = Xmult(n,5) or rule90(n,1).

Original entry on oeis.org

0, 5, 10, 15, 20, 17, 30, 27, 40, 45, 34, 39, 60, 57, 54, 51, 80, 85, 90, 95, 68, 65, 78, 75, 120, 125, 114, 119, 108, 105, 102, 99, 160, 165, 170, 175, 180, 177, 190, 187, 136, 141, 130, 135, 156, 153, 150, 147, 240, 245, 250, 255, 228, 225, 238, 235, 216, 221, 210
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

The orbit of 1 under iteration of this function is the Sierpinski gasket A038183. It is called "rule 90" because the 8 bits of 90 = 01011010 in binary give bit k of the result as function of the value in {0,...,7} made out of bits k,k+1,k+2 of the input (i.e., floor(input / 2^k) mod 8). - M. F. Hasler, Oct 09 2017

Examples

			   n (in binary) | 4n [binary] | n XOR 4n [binary] | [decimal] = a(n)
          0      |        0    |           0       |        0
          1      |      100    |         101       |        5
         10      |     1000    |        1010       |       10
         11      |     1100    |        1111       |       15
        100      |    10000    |       10100       |       20
        101      |    10100    |       10001       |       17
   etc.
		

Crossrefs

Cf. A038183.
Cf. A353167 (terms sorted).

Programs

Formula

a(n) = n XOR n*2 XOR (n XOR n*2)*2 = A048724(A048724(n)). - Reinhard Zumkeller, Nov 12 2004
a(n) = n XOR (4n). - M. F. Hasler, Oct 09 2017

A277320 Square array A(r,c) = A048720(A065621(r), c), read by descending antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Original entry on oeis.org

1, 2, 2, 3, 4, 7, 4, 6, 14, 4, 5, 8, 9, 8, 13, 6, 10, 28, 12, 26, 14, 7, 12, 27, 16, 23, 28, 11, 8, 14, 18, 20, 52, 18, 22, 8, 9, 16, 21, 24, 57, 56, 29, 16, 25, 10, 18, 56, 28, 46, 54, 44, 24, 50, 26, 11, 20, 63, 32, 35, 36, 39, 32, 43, 52, 31, 12, 22, 54, 36, 104, 42, 58, 40, 100, 46, 62, 28, 13, 24, 49, 40, 101, 112, 49, 48, 125, 104, 33, 56, 21
Offset: 1

Views

Author

Antti Karttunen, Nov 01 2016

Keywords

Examples

			The top left corner of the array:
   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12
   2,   4,   6,   8,  10,  12,  14,  16,  18,  20,  22,  24
   7,  14,   9,  28,  27,  18,  21,  56,  63,  54,  49,  36
   4,   8,  12,  16,  20,  24,  28,  32,  36,  40,  44,  48
  13,  26,  23,  52,  57,  46,  35, 104, 101, 114, 127,  92
  14,  28,  18,  56,  54,  36,  42, 112, 126, 108,  98,  72
  11,  22,  29,  44,  39,  58,  49,  88,  83,  78,  69, 116
   8,  16,  24,  32,  40,  48,  56,  64,  72,  80,  88,  96
  25,  50,  43, 100, 125,  86,  79, 200, 209, 250, 227, 172
  26,  52,  46, 104, 114,  92,  70, 208, 202, 228, 254, 184
  31,  62,  33, 124,  99,  66,  93, 248, 231, 198, 217, 132
  28,  56,  36, 112, 108,  72,  84, 224, 252, 216, 196, 144
  21,  42,  63,  84,  65, 126, 107, 168, 189, 130, 151, 252
  22,  44,  58,  88,  78, 116,  98, 176, 166, 156, 138, 232
  19,  38,  53,  76,  95, 106, 121, 152, 139, 190, 173, 212
  16,  32,  48,  64,  80,  96, 112, 128, 144, 160, 176, 192
  49,  98,  83, 196, 245, 166, 151, 392, 441, 490, 475, 332
  50, 100,  86, 200, 250, 172, 158, 400, 418, 500, 454, 344
  55, 110,  89, 220, 235, 178, 133, 440, 399, 470, 481, 356
		

Crossrefs

Transpose: A277199.
Main diagonal: A277699.
Row 1: A000027, Row 3: A048727.
Column 1: A065621, Column 3: A277823, Column 5: A277825.
Cf. A277820 (array obtained by selecting only the columns with an index A001317(k), k=0..).

Programs

Formula

A(r,c) = A048720(A065621(r), c).

A048715 Binary expansion matches (100(0)*)*(0|1|10)?; or, Zeckendorf-like expansion of n using recurrence f(n) = f(n-1) + f(n-3).

Original entry on oeis.org

0, 1, 2, 4, 8, 9, 16, 17, 18, 32, 33, 34, 36, 64, 65, 66, 68, 72, 73, 128, 129, 130, 132, 136, 137, 144, 145, 146, 256, 257, 258, 260, 264, 265, 272, 273, 274, 288, 289, 290, 292, 512, 513, 514, 516, 520, 521, 528, 529, 530, 544, 545, 546, 548, 576, 577, 578, 580
Offset: 0

Views

Author

Antti Karttunen, Mar 30 1999

Keywords

Comments

No more than one 1-bit in each bit triple.
All terms satisfy A048727(n) = 7*n.
Constructed from A000930 in the same way as A003714 is constructed from A000045.
It appears that n is in the sequence if and only if C(7n,n) is odd (cf. A003714). - Benoit Cloitre, Mar 09 2003
The conjecture by Benoit is correct. This is easily proved using the well-known result that the multiplicity with which a prime p divides C(n+m,n) is the number of carries when adding n+m in base p. - Franklin T. Adams-Watters, Oct 06 2009
Appears to be the set of numbers x such that (x AND 5*x) = x and (x OR 3*x)/x = 3. - Gary Detlefs, Jun 08 2024

Crossrefs

Programs

  • Mathematica
    Reap[Do[If[OddQ[Binomial[7n, n]], Sow[n]], {n, 0, 400}]][[2, 1]]
    (* Second program: *)
    filterQ[n_] := With[{bb = IntegerDigits[n, 2]}, !MatchQ[bb, {_, 1, 0, 1, _}|{_, 1, 1, _}]];
    Select[Range[0, 580], filterQ] (* Jean-François Alcover, Dec 31 2020 *)
  • PARI
    is(n)=!bitand(n, 6*n) \\ Charles R Greathouse IV, Oct 03 2016
    
  • Perl
    for my $k (0..580) { print "$k, " if sprintf("%b", $k) =~ m{^(100(0)*)*(0|1|10)?$}; } # Georg Fischer, Jun 26 2021
    
  • Python
    import re
    def ok(n): return re.fullmatch('(100(0)*)*(0|1|10)?', bin(n)[2:]) != None
    print(list(filter(ok, range(581)))) # Michael S. Branicky, Jun 26 2021

Formula

a(0) = 0, a(n) = (2^(invfoo(n)-1))+a(n-foo(invfoo(n))), where foo(n) is foo(n-1) + foo(n-3) (A000930) and invfoo is its "integral" (floored down) inverse.
a(n) XOR 6*a(n) = 7*a(n); 3*a(n) XOR 4*a(n) = 7*a(n); 3*a(n) XOR 5*a(n) = 6*a(n); (conjectures). - Paul D. Hanna, Jan 22 2006
The conjectures can be verified using the Walnut theorem-prover (see links). - Sebastian Karlsson, Dec 31 2022

Extensions

Definition corrected by Georg Fischer, Jun 26 2021

A269161 Formula for Wolfram's Rule 86 cellular automaton: a(n) = 4n XOR (2n OR n).

Original entry on oeis.org

0, 7, 14, 11, 28, 27, 22, 19, 56, 63, 54, 51, 44, 43, 38, 35, 112, 119, 126, 123, 108, 107, 102, 99, 88, 95, 86, 83, 76, 75, 70, 67, 224, 231, 238, 235, 252, 251, 246, 243, 216, 223, 214, 211, 204, 203, 198, 195, 176, 183, 190, 187, 172, 171, 166, 163, 152, 159, 150, 147, 140, 139, 134, 131, 448, 455, 462, 459
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2016

Keywords

Comments

The sequence is injective: no value occurs more than once.
Fibbinary numbers (A003714) give all integers n>=0 for which a(n) = A048727(n) and for which a(n) = A269160(n).

Crossrefs

Cf. A265281 (iterates starting from 1).
Cf. also A048727, A269160.

Programs

Formula

a(n) = 4n XOR (2n OR n) = A003987(4*n, A003986(2*n, n)).
a(n) = 4*n XOR A163617(n).
Other identities. For all n >= 0:
a(2*n) = 2*a(n).
a(n) = A057889(A269160(A057889(n))). [Rule 86 is the mirror image of rule 30.]

A213370 a(n) = n AND 2*n, where AND is the bitwise AND operator.

Original entry on oeis.org

0, 0, 0, 2, 0, 0, 4, 6, 0, 0, 0, 2, 8, 8, 12, 14, 0, 0, 0, 2, 0, 0, 4, 6, 16, 16, 16, 18, 24, 24, 28, 30, 0, 0, 0, 2, 0, 0, 4, 6, 0, 0, 0, 2, 8, 8, 12, 14, 32, 32, 32, 34, 32, 32, 36, 38, 48, 48, 48, 50, 56, 56, 60, 62, 0, 0, 0, 2, 0, 0, 4, 6, 0, 0, 0, 2, 8, 8
Offset: 0

Views

Author

Alex Ratushnyak, Jun 14 2012

Keywords

Crossrefs

Cf. A003714: indices of 0's.
Cf. A213540: indices of 2's, indices of 4's divided by 2.

Programs

  • Mathematica
    Table[BitAnd[n, 2n], {n, 0, 63}] (* Alonso del Arte, Jun 19 2012 *)
  • PARI
    a(n) = bitand(n, 2*n); \\ Michel Marcus, Mar 26 2021
  • Python
    for n in range(99):
        print(2*n & n, end=", ")
    

Formula

a(n) = 2 * A048735(n).
a(n) = (1/2)*(A048727(n) XOR A269160(n)) = (n OR 2n) XOR (n XOR 2n). - Antti Karttunen, May 16 2021

A048717 Binary expansion matches ((0)*00(1*)11)*(0*).

Original entry on oeis.org

0, 3, 6, 7, 12, 14, 15, 24, 28, 30, 31, 48, 51, 56, 60, 62, 63, 96, 99, 102, 103, 112, 115, 120, 124, 126, 127, 192, 195, 198, 199, 204, 206, 207, 224, 227, 230, 231, 240, 243, 248, 252, 254, 255, 384, 387, 390, 391
Offset: 0

Views

Author

Antti Karttunen, Mar 30 1999

Keywords

Comments

In binary expansion, 1-bits occur only in groups of two or more, separated from other such groups by at least two 0-bits.
Integers that satisfy A048727(n) = 3*n.

Crossrefs

Row 3 of A115872. Superset of A048719. Cf. A048733.

Programs

  • Mathematica
    filterQ[n_] := !MatchQ[IntegerDigits[n, 2], {1}|{1, 0, _}|{_, 0, 1}|{_, 1, 0, 1, _}|{_, 0, 1, 0, _}];
    Select[Range[0, 400], filterQ] (* Jean-François Alcover, Dec 31 2020 *)
Showing 1-10 of 15 results. Next