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-1 of 1 results.

A367021 Numbers that can be written as both the sum of two or more consecutive nonprimes and the sum of two or more consecutive primes.

Original entry on oeis.org

5, 10, 17, 18, 23, 26, 28, 31, 36, 39, 41, 49, 53, 58, 59, 60, 67, 68, 71, 75, 77, 78, 83, 84, 90, 95, 97, 101, 102, 109, 112, 121, 124, 127, 128, 129, 131, 132, 138, 139, 143, 150, 152, 155, 156, 158, 159, 160, 161, 162, 168, 169, 172, 173, 180, 181, 184, 187, 192
Offset: 1

Views

Author

Tamas Sandor Nagy, Nov 01 2023

Keywords

Comments

It seems that more than one consecutive number set from one kind or the other may exist for a term. Also, for some terms, an equal number of addends from each kind may correspond.

Examples

			5 is a term because 5 = 1 + 4 = 2 + 3, which is the sum of two consecutive nonprimes and also the sum of two consecutive primes.
17 is a term because 17 = 8 + 9 = 2 + 3 + 5 + 7, the sum of two consecutive nonprimes and also the sum of four consecutive primes.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    primes = [x for x in range(2,3000) if isprime(x)]
    comps = [x for x in range(1,3000) if not isprime(x)]
    psums = set(sum(primes[p:p+pn]) for pn in range(2,100) for p in range(len(primes)-pn))
    csums = set(sum(comps[c:c+cn]) for cn in range(2,100) for c in range(len(comps)-cn))
    terms = sorted(list(psums.intersection(csums)))
    print(terms)
    # David Consiglio, Jr., Dec 18 2023

Extensions

More terms from David Consiglio, Jr., Dec 18 2023
Showing 1-1 of 1 results.