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.

User: Christopher Purcell

Christopher Purcell's wiki page.

Christopher Purcell has authored 3 sequences.

A384868 a(n) = Sum_{i=1...|b|} i*(-1)^b_i where b is the lexicographically n-th binary string.

Original entry on oeis.org

0, 1, -1, 3, -1, 1, -3, 6, 0, 2, -4, 4, -2, 0, -6, 10, 2, 4, -4, 6, -2, 0, -8, 8, 0, 2, -6, 4, -4, -2, -10, 15, 5, 7, -3, 9, -1, 1, -9, 11, 1, 3, -7, 5, -5, -3, -13, 13, 3, 5, -5, 7, -3, -1, -11, 9, -1, 1, -9, 3, -7, -5, -15, 21, 9, 11, -1, 13, 1, 3, -9, 15, 3, 5, -7, 7, -5, -3, -15, 17
Offset: 0

Author

Christopher Purcell, Jun 11 2025

Keywords

Comments

The first binary string is the empty string and is indexed n=0.

Examples

			The lexicographically 8th binary string is 001; therefore, a(8) = 1 + 2 - 3 = 0.
Sequence can be written as triangle T(n,k) with row lengths 2^n:
   0;
   1, -1;
   3, -1, 1, -3;
   6,  0, 2, -4, 4, -2, 0, -6;
  10,  2, 4, -4, 6, -2, 0, -8, 8, 0, 2, -6, 4, -4, -2, -10;
  ...
		

Programs

  • PARI
    a(n) = my(b=[d|d<-binary(n+1)[^1]]); sum(i=1, #b, i*(-1)^b[i]); \\ Michel Marcus, Jun 11 2025
    
  • Python
    from math import comb
    def A384868(n): return comb(len(s:=bin(n+1)[3:])+1,2)-(sum(i for i,j in enumerate(s,1) if j=='1')<<1) # Chai Wah Wu, Jun 13 2025
    
  • Python
    def a384868(n): return sum(i if b == '0' else -i for i, b in enumerate(bin(n + 1)[3:], 1)) # David Radcliffe, Jun 15 2025

Formula

From Alois P. Heinz, Jun 13 2025: (Start)
a(A000225(n)) = A000217(n).
a(2*(2^n-1)) = (-1)*A000217(n).
Sum_{i=0..2^n-1} a(i+2^n-1) = 0.
Sum_{i=0..2^n-1} i*a(i+2^n-1) = (-1)*A100575(n+1).
Sum_{i=0..2^n-1} abs(a(i+2^n-1)) = 2*A377170(n). (End)

A333717 a(n) is the minimal number of vertices in a simple graph with exactly n cycles.

Original entry on oeis.org

3, 5, 4, 6, 8, 5, 4, 6, 8, 6, 6, 5, 5, 6, 6, 8, 7, 6, 6, 6, 6, 5, 6, 6, 7, 7, 7, 7, 7, 6, 7, 6, 6, 7, 6, 6, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 7, 7, 7, 7, 6, 7, 7, 7, 6, 7, 7, 7, 8, 8, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7
Offset: 1

Author

Christopher Purcell, Sep 03 2020

Keywords

Comments

a(n+1) is at most a(n) + 2 since we can add a triangle to a graph with a(n) vertices and increase the number of cycles by 1.
David Eppstein observed that an N-gon with each edge replaced by a triangle has 2^N + N cycles and 2N vertices, and gluing such graphs together greedily yields an upper bound on a(n) of O(log n).

Examples

			For n = 2, a pair of triangles sharing a vertex has five vertices; it is easy to check that no graph on three or four vertices has exactly two cycles, so a(2) = 5.
		

A300758 a(n) = 2n*(n+1)*(2n+1).

Original entry on oeis.org

0, 12, 60, 168, 360, 660, 1092, 1680, 2448, 3420, 4620, 6072, 7800, 9828, 12180, 14880, 17952, 21420, 25308, 29640, 34440, 39732, 45540, 51888, 58800, 66300, 74412, 83160, 92568, 102660, 113460, 124992, 137280, 150348, 164220, 178920, 194472, 210900, 228228
Offset: 0

Author

Christopher Purcell, Mar 12 2018

Keywords

Comments

The altitude h(n) = a(n)/A001844(n) of the (A005408(n), A046092(n) and A001844(n)) rectangular triangle is an irreducible fraction. - Ralf Steiner, Feb 25 2020
In this case, area A = a(n)/2 = A055112(n). - Bernard Schott, Feb 27 2020

Formula

a(n) = 12*A000330(n).
G.f.: 12*x*(1+x)/(1-x)^4. - Colin Barker, Mar 12 2018
a(n) = 6*A006331(n) = 4*A059270(n) = 3*A002492(n) = 2*A055112(n). - Omar E. Pol, Apr 04 2018
From Ralf Steiner, Feb 27 2020: (Start)
a(n) = 2*n*A000384(n+1).
a(n) = sqrt(A016754(n)*A060300(n)).
(End)
a(n) = A005408(n) * A046092(n). - Bruce J. Nicholson, Apr 24 2020

Extensions

Edited by N. J. A. Sloane, Aug 01 2019