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

A241856 Smallest number of carries while adding two primes in binary, the sum of which is 2*n.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Apr 30 2014

Keywords

Examples

			Let n=5. We have 2*5=10=3+7=5+5. Adding 3+7 in binary requires 3 carries, while adding 5+5 in binary requires 2 carries. Thus a(5)=2.
		

Crossrefs

Extensions

More terms from Peter J. C. Moses, Apr 30 2014

A241857 Number of primes p less than prime(n)-1, such that adding prime(n)-1 and p in binary does not require any carry.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Apr 30 2014

Keywords

Comments

Or the number of primes less than prime(n)-1, such that
A000120(prime(n)+p-1) = A000120(p) + A000120(prime(n)-1).

Examples

			Let n=12. Prime(12)-1=37-1=36. There are only 5 primes less than 36 the adding of which with 36 does not require any carry: 2,3,11,17,19. So a(12)=5.
		

Crossrefs

Programs

  • Sage
    def count(x):
        c = 0
        for y in prime_range(x):
            if binomial(y+x-1,y) % 2:
                c += 1
        return c
    [count(i) for i in primes_first_n(100)] # - Tom Edgar, May 01 2014

Formula

For Mersenne prime(n), a(n)=0; for Fermat prime(n)>3, a(n)= n-1.

Extensions

More terms from Peter J. C. Moses, Apr 30 2014
Showing 1-2 of 2 results.