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: Brian Darrow, Jr.

Brian Darrow, Jr.'s wiki page.

Brian Darrow, Jr. has authored 2 sequences.

A365554 Number of increasing paths from the bottom to the top of the n-hypercube (as a graded poset) which first encounter a vector of isolated zeros at stage k, weighted by k.

Original entry on oeis.org

2, 10, 60, 396, 2976, 25056, 234720, 2423520, 27371520, 335819520, 4449150720, 63318931200, 963548006400, 15614378035200, 268480048435200, 4882321001779200, 93627018326016000, 1888394741194752000, 39963486306078720000, 885457095215616000000
Offset: 2

Author

Brian Darrow, Jr. and Joe Fields, Feb 20 2024

Keywords

Comments

These are the numerators in calculating an expected value. The expectation of the number of steps one takes in marking the elements of a predetermined list before reaching a state where only isolated unmarked entries remain.

Examples

			For n=5, an example vector of isolated 0's is 01011, which has k=3 1's.
For n=3, the following paths (from 000 to 111) reach isolated 0's at k=1 many 1's (010):
  000,010,011,111
  000,010,110,111
The following paths reach isolated 0's only at k=2 1's:
  000,100,110,111
  000,100,101,111
  000,001,101,111
  000,001,011,111
So 2 paths of k=1 and 4 paths of k=2 are weighted total a(3) = 2*1 + 4*2 = 10.
		

Crossrefs

Cf. A067331.

Programs

  • PARI
    a(n) = sum(k=n\2, n-1, k*(binomial(k+1,n-k)-binomial(k-1,n-k))*k!*(n-k)!) \\ Andrew Howroyd, Feb 23 2024
  • SageMath
    k, n = var('k,n')
    sum((binomial(k+1,n-k)-binomial(k-1,n-k))*factorial(k)*factorial(n-k), k, floor(n/2),n-1)
    

Formula

a(n) = Sum_{k=floor(n/2)..n-1} k*(binomial(k+1,n-k)-binomial(k-1,n-k))*k!*(n-k)!.

A363992 The number of ways 2n can be expressed as the sum of an odd prime number and an odd nonprime, both of which are relatively prime to n.

Original entry on oeis.org

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

Author

Brian Darrow, Jr., Jun 30 2023

Keywords

Examples

			For n=24 (2n=48), we have a(24)=3 since 48=1+47, 48=13+35, and 48=23+25. These are the only sums containing one prime and one nonprime, both of which are relatively prime to n.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
       nops(select(k -> igcd(n,k) = 1 and igcd(n,2*n-k) = 1 and isprime(k) and not isprime(2*n-k), [seq(k,k=1..2*n-1,2)]))
    end proc:
    map(f, [$0..100]); # Robert Israel, Jul 03 2023
  • Sage
    def d(a):
        """
        This function returns the number of ways n=2a can be expressed as the sum of one prime number and an odd composite that are relatively prime to n
        """
        d=0
        for i in range(1,a+1):
            if ((is_prime(i) and not is_prime(2*a-i) and gcd(i,2*a-i) == 1)) or ((not is_prime(i) and is_prime(2*a-i) and gcd(i,2*a-i) == 1)):
                d=d+1
        return d