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.

A253085 a(n) = A247649(A247647(n)).

Original entry on oeis.org

5, 7, 17, 19, 19, 31, 25, 61, 71, 41, 71, 77, 71, 91, 77, 107, 121, 85, 113, 103, 217, 251, 125, 251, 281, 121, 185, 151, 251, 289, 151, 281, 307, 251, 335, 281, 311, 349, 289, 373, 307, 383, 445, 247, 445, 487, 289, 397, 331, 389, 439, 331, 463, 409, 773, 895, 457, 895, 997, 349
Offset: 1

Views

Author

N. J. A. Sloane, Feb 06 2015

Keywords

Comments

The terms of A247649 are products of terms from this subsequence.
It would be nice to have a characterization of this sequence that is independent of A247649.

Crossrefs

A385887 The number k such that the k-th composition in standard order is the reversed sequence of lengths of maximal runs of binary indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 17 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The binary indices of 100 are {3,6,7}, with maximal runs ((3),(6,7)), with reversed lengths (2,1), which is the 5th composition in standard order, so a(100) = 5.
		

Crossrefs

Removing duplicates appears to give A232559, see also A348366, A358654, A385818.
Sorted positions of firsts appearances appear to be A247648+1.
The non-reverse version is A385889.
A245563 lists run-lengths of binary indices (ranks A246029), reverse A245562.
A384877 lists anti-run lengths of binary indices (ranks A385816), reverse A209859.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    Table[stcinv[Reverse[Length/@Split[bpe[n],#2==#1+1&]]],{n,0,100}]

A247875 Numbers that are even or whose binary expansions contain one or more pairs of adjacent zeros when odd.

Original entry on oeis.org

0, 2, 4, 6, 8, 9, 10, 12, 14, 16, 17, 18, 19, 20, 22, 24, 25, 26, 28, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 46, 48, 49, 50, 51, 52, 54, 56, 57, 58, 60, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 86
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 25 2014

Keywords

Comments

Complement of A247648; union of A004753 and A005843.

Crossrefs

Programs

  • Haskell
    a247875 n = a247875_list !! (n-1)
    a247875_list = filter (\x -> even x || f x) [0..] where
       f x = x > 0 && (x `mod` 4 == 0 || f (x `div` 2))
    
  • Mathematica
    Module[{upto=100,odds},odds=Select[Range[1,upto,2], SequenceCount[ IntegerDigits[#,2],{0,0}]>0&];Sort[Join[odds,Range[0,upto,2]]]] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Aug 30 2015 *)
  • Python
    A247875_list = [n for n in range(10**3) if not n % 2 or '00' in bin(n)]
    # Chai Wah Wu, Sep 26 2014

Extensions

Definition edited by Chai Wah Wu, Sep 26 2014
Definition clarified by Harvey P. Dale, Aug 30 2015

A265716 a(n) = n IMPL (2*n), where IMPL is the bitwise logical implication.

Original entry on oeis.org

0, 2, 5, 6, 11, 10, 13, 14, 23, 22, 21, 22, 27, 26, 29, 30, 47, 46, 45, 46, 43, 42, 45, 46, 55, 54, 53, 54, 59, 58, 61, 62, 95, 94, 93, 94, 91, 90, 93, 94, 87, 86, 85, 86, 91, 90, 93, 94, 111, 110, 109, 110, 107, 106, 109, 110, 119, 118, 117, 118, 123, 122
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 15 2015

Keywords

Comments

The scatterplot exhibits fractal qualities. - Bill McEachen, Dec 27 2022

Examples

			.      2*21=42 | 101010                      2*6=12 | 1100
.           21 |  10101                           6 |  110
.   -----------+-------                   ----------+-----
.   21 IMPL 42 | 101010 -> a(21) = 42     6 IMPL 12 | 1101 -> a(6) = 13 .
		

Crossrefs

Programs

  • Haskell
    a265716 n = n `bimpl` (2 * n) where
       bimpl 0 0 = 0
       bimpl p q = 2 * bimpl p' q' + if u <= v then 1 else 0
                   where (p', u) = divMod p 2; (q', v) = divMod q 2
    
  • Maple
    A265716 := n -> Bits:-Implies(n, 2*n):
    seq(A265716(n), n=0..61); # Peter Luschny, Sep 23 2019
  • Mathematica
    IMPL[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[k, 2]]-1-n, k]];
    a[n_] := n ~IMPL~ (2n);
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 16 2021 *)
  • PARI
    a(n)=bitor(bitneg(n, exponent(n)+1), 2*n) \\ Charles R Greathouse IV, Jan 20 2023

Formula

a(n) = A265705(2*n,n): central terms of triangle A265705;
a(A247648(n)) = 2*A247648(n).
a(n)= bitor(A003817(n)-n, 2*n) (conjectured). - Bill McEachen, Dec 13 2021
2n <= a(n) <= 3n. - Charles R Greathouse IV, Jan 20 2023

A246314 Number of odd terms in f^n, where f = 1/x^2+1/x+1+x+x^2+1/y^2+1/y+y+y^2.

Original entry on oeis.org

1, 9, 9, 37, 9, 65, 37, 157, 9, 81, 65, 237, 37, 293, 157, 713, 9, 81, 81, 333, 65, 473, 237, 1077, 37, 333, 293, 1129, 157, 1285, 713, 2737, 9, 81, 81, 333, 81, 585, 333, 1413, 65, 585, 473, 1733, 237, 1933, 1077, 4337, 37, 333, 333, 1369, 293, 2125, 1129, 4969, 157, 1413, 1285, 5041, 713, 5561, 2737, 11421, 9, 81
Offset: 0

Views

Author

N. J. A. Sloane, Aug 26 2014

Keywords

Comments

This is the number of ON cells in a certain 2-D CA in which the neighborhood of a cell is defined by f (a cross containing 9 cells), and in which a cell is ON iff there was an odd number of ON cells in the neighborhood at the previous generation.

Examples

			Here is the neighborhood:
[0, 0, X, 0, 0]
[0, 0, X, 0, 0]
[X, X, X, X, X]
[0, 0, X, 0, 0]
[0, 0, X, 0, 0]
which contains a(1) = 9 ON cells.
The second and third generations are:
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[X, 0, X, 0, X, 0, X, 0, X]  (again with 9 ON cells)
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, X, 0, X, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, X, 0, 0, X, X, X, 0, 0, X, 0, 0]
[0, 0, X, 0, X, 0, 0, 0, X, 0, X, 0, 0]
[X, X, 0, 0, X, 0, X, 0, X, 0, 0, X, X] (with 37 ON cells)
[0, 0, X, 0, X, 0, 0, 0, X, 0, X, 0, 0]
[0, 0, X, 0, 0, X, X, X, 0, 0, X, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, X, 0, X, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
The terms can be arranged into blocks of sizes 1,1,2,4,8,16,32,...:
1,
9,
9, 37,
9, 65, 37, 157,
9, 81, 65, 237, 37, 293, 157, 713,
9, 81, 81, 333, 65, 473, 237, 1077, 37, 333, 293, 1129, 157, 1285, 713, 2737,
9, 81, 81, 333, 81, 585, 333, 1413, 65, 585, 473, 1733, 237, 1933, 1077, 4337, 37, 333, 333, 1369, 293, 2125, 1129, 4969, 157, 1413, 1285, 5041, 713, 5561, 2737, 11421, ...
The final terms in the rows are A246315.
		

Crossrefs

Other CA's that use the same rule but with different cell neighborhoods: A160239, A102376, A071053, A072272, A001316, A246034, A246035, A246037.

Programs

  • Maple
    C:=f->subs({x=1, y=1}, f);
    # Find number of ON cells in CA for generations 0 thru M defined by rule
    # that cell is ON iff number of ON cells in nbd at time n-1 was odd
    # where nbd is defined by a polynomial or Laurent series f(x, y).
    OddCA:=proc(f, M) global C; local n, a, i, f2, p;
    f2:=simplify(expand(f)) mod 2;
    a:=[]; p:=1;
    for n from 0 to M do a:=[op(a), C(p)]; p:=expand(p*f2) mod 2; od:
    lprint([seq(a[i], i=1..nops(a))]);
    end;
    f:=1/x^2+1/x+1+x+x^2+1/y^2+1/y+y+y^2;
    OddCA(f, 70);
  • Mathematica
    c[f_] := f /. {x -> 1, y -> 1};
    OddCA[f_, M_] := Module[{a = {}, f2, p = 1}, f2 = PolynomialMod[f, 2]; Do[ AppendTo[a, c[p]]; Print[a]; p = PolynomialMod[p f2, 2], {n, 0, M}]; a];
    f = 1/x^2 + 1/x + 1 + x + x^2 + 1/y^2 + 1/y + y + y^2;
    OddCA[f, 70] (* Jean-François Alcover, May 24 2020, after Maple *)

Formula

The values of a(n) for n in A247647 (or A247648) determine all the values, as follows. Parse the binary expansion of n into terms from A247647 separated by at least two zeros: m_1 0...0 m_2 0...0 m_3 ... m_r 0...0. Ignore any number (one or more) of trailing zeros. Then a(n) = a(m_1)*a(m_2)*...*a(m_r). For example, n = 37_10 = 100101_2 is parsed into 1.00.101, and so a(37) = a(1)*a(5) = 9*65 = 585. This is a generalization of the Run Length Transform.

A247650 Number of terms in expansion of f^n mod 2, where f = (1/x^2+1/x+1+x+x^2)*(1/y^2+1/y+1+y+y^2) mod 2.

Original entry on oeis.org

1, 25, 25, 49, 25, 289, 49, 361, 25, 625, 289, 361, 49, 961, 361, 625, 25, 625, 625, 1225, 289, 3721, 361, 5041, 49, 1225, 961, 1681, 361, 5041, 625, 5929, 25, 625, 625, 1225, 625, 7225, 1225, 9025, 289, 7225, 3721, 5041, 361, 8281, 5041, 5929, 49, 1225
Offset: 0

Views

Author

N. J. A. Sloane, Sep 25 2014

Keywords

Comments

This is the number of cells that are ON after n generations in a two-dimensional cellular automaton defined by the odd-neighbor rule where the neighborhood consists of a 5X5 block of contiguous cells.

Crossrefs

Programs

  • Python
    import sympy
    from operator import mul
    from functools import reduce
    x, y = sympy.symbols('x y')
    f = ((1/x**2+1/x+1+x+x**2)*(1/y**2+1/y+1+y+y**2)).expand(modulus=2)
    A247650_list, g = [1], 1
    for n in range(1, 101):
        s = [int(d, 2) for d in bin(n)[2:].split('00') if d != '']
        g = (g*f).expand(modulus=2)
        if len(s) == 1:
            A247650_list.append(g.subs([(x, 1), (y, 1)]))
        else:
            A247650_list.append(reduce(mul, (A247650_list[d] for d in s)))
    # Chai Wah Wu, Sep 25 2014

Formula

The values of a(n) for n in A247647 (or A247648) determine all the values, as follows. Parse the binary expansion of n into terms from A247647 separated by at least two zeros: m_1 0...0 m_2 0...0 m_3 ... m_r 0...0. Ignore any number (one or more) of trailing zeros. Then a(n) = a(m_1)*a(m_2)*...*a(m_r). For example, n = 37_10 = 100101_2 is parsed into 1.00.101, and so a(37) = a(1)*a(5) = 25*289 = 7225. This is a generalization of the Run Length Transform.

A334076 a(n) = bitwise NOR of n and 2n.

Original entry on oeis.org

0, 0, 1, 0, 3, 0, 1, 0, 7, 4, 1, 0, 3, 0, 1, 0, 15, 12, 9, 8, 3, 0, 1, 0, 7, 4, 1, 0, 3, 0, 1, 0, 31, 28, 25, 24, 19, 16, 17, 16, 7, 4, 1, 0, 3, 0, 1, 0, 15, 12, 9, 8, 3, 0, 1, 0, 7, 4, 1, 0, 3, 0, 1, 0, 63, 60, 57, 56, 51, 48, 49, 48, 39, 36, 33, 32, 35, 32, 33
Offset: 0

Views

Author

Alois P. Heinz, Apr 13 2020

Keywords

Comments

Exactly all bits that are 0 in both parameters (but not a leading 0 of both) are set to 1 in the output of bitwise NOR.

Crossrefs

Programs

  • Maple
    a:= n-> Bits[Nor](n, 2*n):
    seq(a(n), n=0..127);
  • PARI
    a(n) = my(x=bitor(n, 2*n)); bitneg(x, #binary(x)); \\ Michel Marcus, Apr 14 2020
  • Python
    def A334076(n):
        m = n|(2*n)
        return 0 if n == 0 else 2**(len(bin(m))-2)-1-m # Chai Wah Wu, Apr 14 2020
    

Formula

a(n) = 0 <=> n in { A247648 } union { 0 }.
a(n) = n-1 <=> n in { A000079 }.
a(n) = n/2 <=> n in { A125835 }.
a(n) = n*3/4 <=> n in { A141032 }.

A370762 Triangle read by rows: T(n,k) = 2 * (k mod 2 + 1) * T(n-1,floor(k/2)) + 1 with T(0,0) = 1 for 0 <= k <= 2^n-1.

Original entry on oeis.org

1, 3, 5, 7, 13, 11, 21, 15, 29, 27, 53, 23, 45, 43, 85, 31, 61, 59, 117, 55, 109, 107, 213, 47, 93, 91, 181, 87, 173, 171, 341, 63, 125, 123, 245, 119, 237, 235, 469, 111, 221, 219, 437, 215, 429, 427, 853, 95, 189, 187, 373, 183, 365, 363, 725, 175, 349, 347, 693, 343, 685, 683, 1365
Offset: 0

Views

Author

Seiichi Manyama, Mar 01 2024

Keywords

Examples

			First few rows are:
   1;
   3,  5;
   7, 13, 11,  21;
  15, 29, 27,  53, 23,  45,  43,  85;
  31, 61, 59, 117, 55, 109, 107, 213, 47, 93, 91, 181, 87, 173, 171, 341;
		

Crossrefs

Row sums give A016129.
Columns k=0 gives A000225(n+1).
Cf. A247648.

Programs

  • PARI
    T(n, k) = if(n==0, 1, 2*(k%2+1)*T(n-1, k\2)+1);

A373629 a(n) = sum of all numbers whose binary expansion is n bits long, starts and ends with a 1 bit, and contains no 00 bit pairs.

Original entry on oeis.org

1, 3, 12, 39, 131, 426, 1389, 4503, 14596, 47259, 152991, 495162, 1602521, 5186067, 16782828, 54310911, 175754731, 568755690, 1840534485, 5956098495, 19274345876, 62373103443, 201843619047, 653179698234, 2113733947681, 6840186809691, 22135309606524, 71631366769623
Offset: 1

Views

Author

Iskender Ozturk, Melike Caliskan, Betül Küçükgök, Ecem Yanik, Irem Türker, Rüya Kılıçarslan, Jun 11 2024

Keywords

Comments

The numbers that are summed are the terms t of A247648 in the range 2^(n-1) <= t < 2^n.
There are Fibonacci(n) of these numbers (per Grimaldi's exercise, in which closed walks on the u-v graph there are a 1 bit at a visit to u and a 0 bit at a visit to v), and this allows recurrences etc. for a(n).

Examples

			For n=5, the terms of A247648 that are in the interval [16, 31] are 21, 23, 27, 29, and 31, so a(5) = 21+23+27+29+31 = 131.
		

References

  • R. Grimaldi, (2012). Fibonacci and Catalan Numbers: An Introduction, page 80, Example 12.1.

Crossrefs

Cf. A000045 (Fibonacci numbers), A247648.

Programs

  • Mathematica
    LinearRecurrence[{3, 3, -6, -4}, {1, 3, 12, 39}, 30] (* Paolo Xausa, Jun 19 2024 *)
  • PARI
    Vec(x/((1 - x - x^2)*(1 - 2*x - 4*x^2)) + O(x^40)) \\ Michel Marcus, Jun 16 2024

Formula

a(n) = Sum_{i=F(n+1)..F(n+2)-1} A247648(i) where F(n) = A000045(n) is the n-th Fibonacci number.
a(n) = a(n-1) + a(n-2) + F(n)*2^(n-1).
a(n) = 3*a(n-1) + 3*a(n-2) - 6*a(n-3) - 4*a(n-4).
a(n) = F(n)*(2^n-1) - Sum_{i=1..n-1} F(i)*F(n-i-1)*2^(n-i-1).
G.f.: x/((1 - x - x^2)*(1 - 2*x - 4*x^2)).
E.g.f.: 2*(exp(x)*(sqrt(5)*cosh(sqrt(5)*x) + 7*sinh(sqrt(5)*x)) - exp(x/2)*(sqrt(5)*cosh(sqrt(5)*x/2) + 4*sinh(sqrt(5)*x/2)))/(11*sqrt(5)). - Stefano Spezia, Jun 19 2024

A380358 Numbers whose binary expansion ends with 11 and does not contain adjacent zeros.

Original entry on oeis.org

3, 7, 11, 15, 23, 27, 31, 43, 47, 55, 59, 63, 87, 91, 95, 107, 111, 119, 123, 127, 171, 175, 183, 187, 191, 215, 219, 223, 235, 239, 247, 251, 255, 343, 347, 351, 363, 367, 375, 379, 383, 427, 431, 439, 443, 447, 471, 475, 479, 491, 495, 503, 507, 511, 683
Offset: 1

Views

Author

R. J. Cintra, Jan 22 2025

Keywords

Comments

The numbers in this sequence appear in the conversion of conventional binary numbers to the canonical signed-digit representation.

Examples

			183 is in the sequence because its binary expansion is 10110111.
		

References

  • J. L. Smith and A. Weinberger, "Shortcut Multiplication for Binary Digital Computers", in Methods for High-Speed Addition and Multiplication, National Bureau of Standards Circular 591, Sec. 1, February, 1958, page 21.

Crossrefs

Programs

  • Mathematica
    Select[4*Range[0, 170] + 3, SequencePosition[IntegerDigits[#, 2], {0, 0}] == {} &] (* Amiram Eldar, Feb 05 2025 *)
  • Python
    from itertools import count, islice
    def A380358_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:n&3==3 and not '00' in bin(n),count(max(startvalue,1)))
    A380358_list = list(islice(A380358_gen(),20)) # Chai Wah Wu, Feb 12 2025

Formula

a(n) = 2 * A247648(n) + 1.
From Hugo Pfoertner, Feb 07 2025: (Start)
a(n) = 4*A052499(n) - 1.
a(n) = 4*(A365808(n+1) + 1)/3 - 1.
a(n) = 2*(A365809(n) + 1)/3 - 1. (End)
Previous Showing 11-20 of 20 results.