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 61-70 of 94 results. Next

A284266 Odd bisection of A277700, binary weight of terms of A283975.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 25 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A277700((2*n)+1).
a(n) = A000120(A283975(n)).
Other identities. For all n >= 0:
A007306(1+n) = a(n) + 2*A284265(n).

A057431 Obtained by reading first the numerator then the denominator of fractions in full Stern-Brocot tree (A007305/A047679).

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 1, 2, 2, 1, 1, 3, 2, 3, 3, 2, 3, 1, 1, 4, 2, 5, 3, 5, 3, 4, 4, 3, 5, 3, 5, 2, 4, 1, 1, 5, 2, 7, 3, 8, 3, 7, 4, 7, 5, 8, 5, 7, 4, 5, 5, 4, 7, 5, 8, 5, 7, 4, 7, 3, 8, 3, 7, 2, 5, 1, 1, 6, 2, 9, 3, 11, 3, 10, 4, 11, 5, 13, 5, 12, 4, 9, 5, 9, 7, 12, 8, 13, 7, 11, 7, 10, 8, 11, 7, 9, 5, 6, 6, 5
Offset: 0

Views

Author

N. J. A. Sloane, Sep 08 2000

Keywords

Comments

When presented in this way, every row (e.g. row 3, 1 3 2 3 3 2 3 1) is a palindrome. - Joshua Zucker, May 11 2006

Crossrefs

Programs

  • Maple
    F:= proc(n) option remember; local t;
    t:= L -> [[L[1], [L[1][1]+L[2][1], L[1][2]+L[2][2]], L[2]],
               [L[2], [L[2][1]+L[3][1], L[2][2]+L[3][2]], L[3]]][];
          if n=0 then [[[ ], [0, 1], [ ]], [[ ], [1, 0], [ ]]]
        elif n=1 then [[[0, 1], [1, 1], [1, 0]]]
                 else map(t, F(n-1))
          fi
        end:
    aa:= n-> map(x-> x[], [seq(map(x-> x[2], F(j))[], j=0..n)])[]:
    aa(7);   # aa(n) gives the first 2^(n+1)+2 terms
    # Alois P. Heinz, Jan 13 2011
  • Mathematica
    sbt[n_] := Module[{R, L, Y, w, u},
       R = {{1, 0}, {1, 1}};
       L = {{1, 1}, {0, 1}};
       Y = {{1, 0}, {0, 1}};
       w[b_] := Fold[#1.If[#2 == 0, L, R]&, Y, b];
       u[a_] := {a[[2, 1]] + a[[2, 2]], a[[1, 1]] + a[[1, 2]]};
       Map[u, Map[w, Tuples[{0, 1}, n]]]];
    Join[{0, 1, 1, 0}, Table[sbt[n], {n, 0, 5}]] // Flatten (* Jean-François Alcover, Sep 06 2022, after Peter Luschny in A007305 *)

Extensions

More terms from Joshua Zucker, May 11 2006

A133404 Table of sum of numerator and denominator of Farey sequences, read by rows.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 3, 5, 2, 1, 5, 4, 3, 5, 7, 2, 1, 6, 5, 4, 7, 3, 8, 5, 7, 9, 2, 1, 7, 6, 5, 4, 7, 3, 8, 5, 7, 9, 11, 2, 1, 8, 7, 6, 5, 9, 4, 7, 10, 3, 11, 8, 5, 12, 7, 9, 11, 13, 2, 1, 9, 8, 7, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 11, 13, 15, 2
Offset: 1

Views

Author

Jonathan Vos Post, Nov 24 2007

Keywords

Comments

Start with the Farey sequence F(n) of order n which is the sequence of completely reduced fractions between 0 and 1 which, when in lowest terms, have denominators less than or equal to n, arranged in order of increasing size. Each row begins with the sum 1 from {0/1}. Each row ends with the sum 2 from {1/1}. The number of elements of the n-th row is A005728(n).

Examples

			F(1) = (0/1, 1/1) -> (0+1=1, 1+1=2).
F(2) = (0/1, 1/2, 1/1) -> (0+1=1, 1+2=3, 1+1=2).
F(3) = (0/1, 1/3, 1/2, 2/3, 1/1) -> (0+1=1, 1+3=4, 1+2=3, 2+3=5, 1+1=2).
F(4) = (0/1, 1/4, 1/3, 1/2, 2/3, 3/4, 1/1) -> (0+1=1, 1+4=5, 1+3=4, 1+2=3, 2+3=5, 3+4=7, 1+1=2).
The 5th row is formed from the 5th row of the table of Farey fractions:
F(5) = (0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1) whose sum of numerators and denominators is (1, 6, 5, 4, 7, 3, 8, 5, 7, 9, 2).
F(6) = (0/1, 1/6, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 1/1) whose sums are (1, 7, 6, 5, 4, 7, 3, 8, 5, 7, 9, 11, 2).
F(7) = (0/1, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 2/5, 3/7, 1/2, 4/7, 3/5, 2/3, 5/7, 3/4, 4/5, 5/6, 6/7, 1/1) whose sums are (1, 8, 7, 6, 5, 9, 4, 7, 10, 3, 11, 8, 5, 12, 7, 9, 11, 13, 2).
F(8) = (0/1, 1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2, 4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 4/5, 5/6, 6/7, 7/8, 1/1) whose sums are (1, 9, 8, 7, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 11, 13, 15, 2).
		

Crossrefs

Programs

  • Maple
    Farey := proc(n) option remember: local j,s: if(n=1)then return {0,1}: else s:=procname(n-1): for j from 1 to n-1 do s := s union {j/n}: od: fi: end:
    for n from 1 to 8 do F:=sort(convert(Farey(n),list)): nF:=nops(F): for m from 1 to nF do printf("%d, ",numer(F[m])+denom(F[m])): od: printf("\n"): od: # Nathaniel Johnston, Apr 27 2011
  • Mathematica
    Farey[n_] := Union[ Flatten[ Join[{0}, Table[a/b, {b, n}, {a, b}]]]]; Table[ Numerator[Farey[n]] + Denominator[Farey[n]], {n, 8}] // Flatten (* Robert G. Wilson v, Jun 10 2011 *)

Formula

A007305/A007306 maps to A007305+A007306 as shown in examples.

Extensions

a(17) inserted by Nathaniel Johnston, Apr 27 2011

A174981 Numerators of the L-tree, left-to-right enumeration.

Original entry on oeis.org

0, 1, 1, 2, 3, 1, 2, 3, 5, 2, 5, 3, 4, 1, 3, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 4, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 5, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19, 7, 16
Offset: 0

Views

Author

Peter Luschny, Apr 03 2010

Keywords

Comments

a(n) is a subsequence of A174980. a(n)/A002487(n+2) enumerates all the reduced nonnegative rational numbers exactly once (L-tree).

Examples

			The sequence splits into rows of length 2^k:
0,
1, 1,
2, 3, 1, 2,
3, 5, 2, 5, 3, 4, 1, 3,
4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 4,
...
The fractions are
0/1,
1/2, 1/1,
2/3, 3/2, 1/3, 2/1,
3/4, 5/3, 2/5, 5/2, 3/5, 4/3, 1/4, 3/1,
4/5, 7/4, 3/7, 8/3, 5/8, 7/5, 2/7, 7/2, 5/7, 8/5, 3/8, 7/3, 4/7, 5/4, 1/5, 4/1,
...
		

Crossrefs

Programs

  • Maple
    SternDijkstra := proc(L, p, n) local k, i, len, M; len := nops(L); M := L; k := n; while k > 0 do M[1+(k mod len)] := add(M[i], i = 1..len); k := iquo(k, len); od; op(p, M) end:
    Ltree := proc(n) 5*2^ilog2(n+1); SternDijkstra([0,1], 1, n + 2 + %) / SternDijkstra([1,0], 2, n + 2) end:
    a := proc(n) 5*2^ilog2(n+1); SternDijkstra([0,1], 1, n + 2 + %) end:
    seq(a(n), n=0..90);
  • Mathematica
    SternDijkstra[L_, p_, n_] := Module[{k, i, len, M}, len := Length[L]; M = L; k = n; While[k > 0, M[[1 + Mod[k, len]]] = Sum[M[[i]], {i, 1, len}]; k = Quotient[k, len]]; M[[p]]]; Ltree[n_] := With[{k = 5*2^Simplify[ Floor[ Log[2, n + 1]]]}, SternDijkstra[{0, 1}, 1, n + 2 + k]/ SternDijkstra[{1, 0}, 2, n + 2]]; a[0] = 0; a[n_] := With[{k = 5*2^Simplify[ Floor[ Log[2, n + 1]]]}, SternDijkstra[{1, 0}, 1, n + 2 + k]]; row[0] = {a[0]}; row[n_] := Table[a[k], {k, 2^n - 3, 2^(n+1) - 4}] // Reverse; Table[row[n], {n, 0, 6}] // Flatten (* Jean-François Alcover, Jul 26 2013, after Maple *)

A282715 Number of nonzero entries in row n of the base-3 generalized Pascal triangle P_3.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 3, 4, 3, 4, 5, 6, 5, 4, 6, 7, 7, 6, 4, 6, 5, 7, 6, 7, 5, 6, 4, 5, 7, 8, 8, 7, 10, 10, 11, 9, 7, 8, 10, 7, 5, 8, 11, 10, 9, 10, 13, 12, 13, 10, 12, 11, 11, 8, 5, 8, 7, 10, 9, 11, 8, 10, 7, 10, 12, 13, 11, 8, 11, 13, 12, 10, 7, 10, 8, 11, 9, 10
Offset: 0

Views

Author

N. J. A. Sloane, Mar 02 2017

Keywords

Comments

It would be nice to have an entry for the triangle P_3 itself (compare A282714 which gives the base-2 triangle P_2).

Examples

			The number of nonzero entries in the n-th row of the following triangle:
  1
  1 1
  1 0 1
  1 1 0 1
  1 2 0 0 1
  1 1 1 0 0 1
  1 0 1 0 0 0 1
  1 1 1 0 0 0 0 1
  1 0 2 0 0 0 0 0 1
  1 1 0 2 0 0 0 0 0 1
  1 2 0 1 1 0 0 0 0 0 1
  1 1 1 1 0 1 0 0 0 0 0 1
  1 2 0 2 1 0 0 0 0 0 0 0 1
  1 3 0 0 3 0 0 0 0 0 0 0 0 1
		

Crossrefs

Programs

  • Maple
    # reuses code snippets of A282714
    A282715 := proc(n)
        add(min(P(n,k,3),1),k=0..n) ;
    end proc:
    seq(A282715(n),n=0..100) ; # R. J. Mathar, Mar 03 2017
  • Mathematica
    row[n_] := Module[{bb, ss}, bb = Table[IntegerDigits[k, 3], {k, 0, n}]; ss = Subsets[Last[bb]]; Prepend[Count[ss, #]& /@ bb // Rest, 1]];
    a[n_] := Count[row[n], _?Positive];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 28 2017 *)

Formula

Leroy et al. (2017) state some conjectured recurrences.

Extensions

More terms from Lars Blomberg, Mar 03 2017

A282720 Number of nonzero terms in first n rows of the base-2 generalized Pascal triangle P_2 (see A282714).

Original entry on oeis.org

0, 1, 3, 6, 9, 13, 18, 23, 27, 32, 39, 47, 54, 61, 69, 76, 81, 87, 96, 107, 117, 128, 141, 153, 162, 171, 183, 196, 207, 217, 228, 237, 243, 250, 261, 275, 288, 303, 321, 338, 351, 365, 384, 405, 423, 440, 459, 475, 486, 497, 513, 532, 549, 567
Offset: 0

Views

Author

N. J. A. Sloane, Mar 03 2017

Keywords

Comments

Same as partial sums of (A007306 with initial 1 omitted).

Crossrefs

Programs

A283974 Numbers n for which A002487(n-1) AND A002487(n) > 0 where AND is bitwise-and (A004198).

Original entry on oeis.org

2, 5, 6, 7, 8, 11, 14, 17, 18, 19, 20, 23, 24, 25, 26, 29, 30, 31, 32, 34, 35, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 86, 89, 92, 95, 96, 97, 98, 101, 104, 107, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Comments

Numbers n such that the binary representations of A002487(n-1) and A002487(n) have at least one 1-bit in a common shared position.

Crossrefs

Cf. A283973 (complement).
Positions of nonzeros in A283988.

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Flatten@ Position[Table[BitAnd[a[n - 1], a@ n], {n, 120}], k_ /; k > 0] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    D(n) = if(n<1, 1, sum(k=0, n, binomial(n + k - 1, 2*k)%2))
    for(n=1, 120, if(bitor(A(n - 1), A(n)) != D(n), print1(n, ", "))) \\ Indranil Ghosh, Mar 23 2017

A284009 Number of primes (counted with multiplicity) dividing lcm(A260443(n), A260443(n+1)): a(n) = A001222(A284008(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 22 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A001222(A284008(n)).
Other identities. For all n >= 0:
a(n) + A277328(n) = A007306(1+n).

A287731 Bisection of A287729.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 3, 4, 5, 5, 4, 3, 3, 2, 1, 1, 2, 3, 3, 4, 5, 5, 4, 5, 7, 8, 7, 7, 8, 7, 5, 6, 9, 11, 10, 11, 13, 12, 9, 9, 12, 13, 11, 10, 11, 9, 6, 5, 7, 8, 7, 7, 8, 7, 5, 4, 5, 5, 4, 3, 3, 2, 1
Offset: 1

Views

Author

I. V. Serov, Jun 01 2017

Keywords

Comments

A287732(n)/a(n) enumerates all reduced fractions along the Stern-Brocot Tree. See the Serov link below.

Crossrefs

Programs

  • Python
    def c(n): return 1 if n==1 else s(n/2) if n%2==0 else s((n - 1)/2) + s((n + 1)/2)
    def s(n): return 0 if n==1 else c(n/2) if n%2==0 else c((n - 1)/2) + c((n + 1)/2)
    def a(n): return c(2*n - 1) # Indranil Ghosh, Jun 08 2017

Formula

a(n) = A287729(2*n-1), n > 0.
a(n) = A287730(n-1) + A287730(n), n > 0.
a(n) = A007306(n) - A287732(n) .
Consider for n > 1 the binary expansion b(1:t) of n-1 without the leading 1.
Recurse: c=s=1; for j=1:t {if b(t-j+1) == mod(t,2) s = s+c; else c = c+s;}
Then: c = a(n) and s = A287732(n);

A287732 Bisection of A287730.

Original entry on oeis.org

0, 1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 3, 4, 5, 5, 4, 5, 7, 8, 7, 7, 8, 7, 5, 4, 5, 5, 4, 3, 3, 2, 1, 1, 2, 3, 3, 4, 5, 5, 4, 5, 7, 8, 7, 7, 8, 7, 5, 6, 9, 11, 10, 11, 13, 12, 9, 9, 12, 13, 11, 10, 11, 9, 6
Offset: 1

Views

Author

I. V. Serov, Jun 01 2017

Keywords

Comments

a(n)/A287731(n) enumerates all reduced fractions along the Stern-Brocot Tree. See the Serov link below.

Crossrefs

Programs

  • Python
    def c(n): return 1 if n==1 else s(n/2) if n%2==0 else s((n - 1)/2) + s((n + 1)/2)
    def s(n): return 0 if n==1 else c(n/2) if n%2==0 else c((n - 1)/2) + c((n + 1)/2)
    def a(n): return s(2*n - 1) # Indranil Ghosh, Jun 08 2017

Formula

a(n) = A287730(2*n-1), n > 0.
a(n) = A287730(n-1) + A287730(n), n > 0.
a(n) = A007306(n) - A287732(n).
Consider for n > 1 the binary expansion b(1:t) of n-1 without the leading 1.
Recurse: c=s=1; for j=1:t {if b(t-j+1) == mod(t,2) s = s+c; else c = c+s;}
Then: c = A287731(n) and s = a(n);
Previous Showing 61-70 of 94 results. Next