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

A332106 Least m > n such that n + ... + m = p*2^k with p prime and k >= 0.

Original entry on oeis.org

2, 2, 3, 4, 7, 6, 7, 9, 9, 10, 13, 12, 19, 16, 15, 16, 31, 20, 19, 22, 21, 22, 25, 24, 40, 28, 27, 34, 31, 30, 31, 33, 35, 34, 37, 36, 37, 52, 41, 40, 43, 42, 169, 46, 45, 52, 61, 50, 49, 52, 51, 52, 55, 54, 55, 58, 57, 184, 70, 69, 67, 67, 65, 64, 67, 66, 73, 70, 69, 70, 442
Offset: 0

Views

Author

M. F. Hasler, Aug 29 2020

Keywords

Comments

Numbers of the form p*2^k (A038550) are the integers having a unique representation as sum of two or more consecutive positive integers, n + ... + m with m > n > 0.
This function is useful for computing A336897 in an efficient way

Examples

			0 + 1 = 1 is not of the required form, but 0 + 1 + 2 = 3 is, so a(0) = 2.
For n = 1, n + 2 = 3 is of the required form, hence a(1) = 2.
For n = 2, n + 3 = 5 is of the required form, hence a(2) = 3.
For n = 3, n + 4 = 7 is of the required form, hence a(3) = 4.
For n = 4, 4 + 5 = 9 and 4 + 5 + 6 = 15 are not of the required form, but 4 + 5 + 6 + 7 = 22 = 11*2 is, hence a(4) = 7.
		

Crossrefs

Programs

  • PARI
    apply( A332106(n)={my(r=1, p=2*(r+n)-1, s=2<
    				

Formula

a(n) = min {p - n, q + n - 1}, where p = 2^r + 2n - 1 and q = 2^s - 2n + 1 are the smallest primes of the respective form.

A337065 Infinite sum of the prime numbers, compacted (see the Comments line for an explanation).

Original entry on oeis.org

5, 12, 24, 59, 97, 84, 159, 128, 144, 162, 186, 420, 647, 457, 503, 360, 1214, 1677, 532, 548, 564, 600, 624, 648, 1033, 1079, 752, 772, 798, 828, 852, 1315, 906, 924, 1924, 3096, 1667, 3496, 1208, 1230, 3834, 1993, 1360, 2101, 1446, 1472, 2251, 1530, 3977, 2471, 1668, 2569
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 14 2020

Keywords

Comments

If the successive terms of the present sequence are expressed as the sum of k>1 consecutive primes in only one way and added, the end result will be 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + ... (conjectured to extend ad infinitum).
This is the lexicographically earliest sequence of distinct positive terms with this property.
a(n) is the smallest term of A084146 such that the set of prime parts of a(n) has (i) no primes in common with the union of the prime parts of a(1), ..., a(n-1) and (ii) contains the smallest prime excluded in the union of the prime parts of a(1), ..., a(n-1). - R. J. Mathar, Aug 19 2020

Examples

			The 1st term is 5 and 5 = 2+3.
The 2nd term is 12 and 12 = 5+7.
The 3rd term is 24 and 24 = 11+13.
The 4th term is 59 and 59 = 17+19+23.
The 5th term is 97 and 97 = 29+31+37.
The 6th term is 84 and 84 = 41+43; etc.
(The 4th term is NOT a(4) = 36 as 36 is the sum of consecutive primes in more than one way: 36 = 17+19 and 36 = 5+7+11+13).
		

Crossrefs

Programs

  • Maple
    # the set of prime partitions of A084146(n)
    A084146Pset := proc(n::integer)
        option remember;
        local pset,k,i,spr ;
        pset := {} ;
        if isA084146(n) then
            for k from 2 do
                if add(ithprime(i),i=1..k) > n then
                    break;
                end if;
                for i from 1 do
                    spr := add( ithprime(j),j=i..i+k-1) ;
                    if spr > n then
                        break;
                    elif spr = n then
                        return {seq(ithprime(j),j=i..i+k-1)} ;
                    end if;
                end do:
            end do:
        end if;
        pset ;
    end proc:
    A337065 := proc(n)
        option remember;
        local pprev,i,pmex,uni, thiss ;
        # the set of all primes needed to represent all previous terms
        pprev := {} ;
        for i from 1 to n-1 do
            pprev := pprev union A084146Pset(procname(i)) ;
        end do ;
        # smallest prime not in the representation of previous terms
        for i from 1 do
            if not ithprime(i) in pprev then
                pmex := ithprime(i) ;
                break;
            end if;
        end do:
        for uni from 1 do
            thiss := A084146Pset(uni) ;
            if pmex in thiss and thiss intersect(pprev) = {} then
                return uni ;
            end if;
        end do:
    end proc:
    for n from 1 do
        print(A337065(n)) ;
    end do: # R. J. Mathar, Aug 19 2020

A337097 Infinite sum of the odd numbers, compacted (see the Comments line for an explanation).

Original entry on oeis.org

4, 12, 20, 28, 57, 203, 76, 129, 371, 124, 201, 219, 237, 623, 505, 327, 2489, 1099, 332, 865, 543, 1337, 2743, 452, 1165, 723, 1757, 1315, 813, 831, 849, 2051, 604, 921, 939, 10757, 1915, 5213, 2095, 3017, 2215, 5993, 2395, 1461, 6539, 2605, 17267, 2965, 1803, 1821, 1839, 1857, 12179, 1324, 8801
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 15 2020

Keywords

Comments

When the successive terms of the present sequence are expressed as the sum of k>1 consecutive odd numbers and added, the end result will be 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17...... (conjectured to extend ad infinitum).
This is the lexicographically earliest sequence of distinct positive terms with this property.
The equivalent sequence with sums of consecutive even numbers is simply A336897 where every term is doubled.

Examples

			The 1st term is 4 and 4 = 1+3.
The 2nd term is 12 and 12 = 5+7.
The 3rd term is 20 and 20 = 9+11.
The 4th term is 28 and 28 = 13+15.
The 5th term is 57 and 57 = 17+19+21; etc.
(The 5th term is NOT 36 as 36 can be expressed as the sum of k>1 consecutive odd numbers in more than one way: 36 = 17+19 and 36 = 1+3+5+7+9+11).
		

Crossrefs

Showing 1-3 of 3 results.