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.

A382381 Lexicographically earliest sequence of distinct positive integers such that any two subsets with at least two terms have distinct variances.

Original entry on oeis.org

1, 2, 4, 8, 16, 25, 36, 62, 136, 320, 411, 1208, 1295, 4179, 5143, 6380, 31370, 34425, 36094, 213044, 218759, 306722
Offset: 1

Views

Author

Pontus von Brömssen, Mar 23 2025

Keywords

Comments

Numbers k such that A381856(k) = 1.
The variance of a nonempty set X is (Sum_{x in X} (x-m)^2)/|X|, where m is the average of X and |X| is the size of X.
a(20) > 100000.

Crossrefs

Programs

  • Python
    from fractions import Fraction
    from itertools import chain, combinations, count, islice
    def powerset(s): # skipping empty set
        return chain.from_iterable(combinations(s, r) for r in range(1, len(s)+1))
    def agen(): # generator of terms
        an, alst, vset = 1, [1], set()
        while True:
            yield an
            P = list(powerset(alst))
            Xlst, X2lst = [sum(s) for s in P], [sum(si**2 for si in s) for s in P]
            for k in count(an+1):
                ok, vnew = True, set()
                for i, s in enumerate(P):
                    mu, X2 = Fraction(Xlst[i] + k, len(s)+1), X2lst[i] + k**2
                    v = Fraction(X2, len(s)+1) - mu**2
                    if v in vset or v in vnew:
                        ok = False
                        break
                    else:
                        vnew.add(v)
                if ok:
                    break
            an = k
            vset |= vnew
            alst.append(an)
    print(list(islice(agen(), 13))) # Michael S. Branicky, Mar 31 2025

Extensions

a(20)-a(21) from Michael S. Branicky, Mar 31 2025
a(22) from Michael S. Branicky, Apr 07 2025

A138858 a(n) = least square such that the subsets of {a(1),...,a(n)} sum to 2^n different values.

Original entry on oeis.org

1, 4, 9, 16, 36, 81, 144, 324, 625, 1156, 2401, 4900, 9801, 19600, 39204, 78400, 156816, 313600, 627264, 1254400, 2509056, 5022081, 10042561, 20088324, 40182921, 80371225, 160731684, 321484900, 642977449, 1285939600, 2571909796, 5143901841, 10287842041, 20575607364, 41151368164, 82303003225, 164606284089, 329212012900, 658425136356, 1316850346681, 2633700545424, 5267401386724
Offset: 1

Views

Author

M. F. Hasler, Apr 09 2008

Keywords

Comments

Asking for 2^n different values implies that a(n) differs from all a(k), k a(n-1) for n>1.
Note that a(n) is close to, but not always larger than sum(a(k),k=1..n-1), as opposed to the case in A064934.
From Martin Fuller, Apr 07 2025: (Start)
a(n) is also the least square which is not in {sum(A)-sum(B) : A,B subsets of {a(1)..a(n-1)}}.
It is much more efficient to work with the complement s(n-1) = {0..sum(a(k),k=1..n-1)} \ {sum(A)-sum(B) : A,B subsets of {a(1)..a(n-1)}}. s(n) can be calculated iteratively and has no more than 7 elements below n=10^6.
Then a(n) is the least square in s(n-1), if any, or else the least square greater than sum(a(k),k=1..n-1).
a(7) and a(10) are the only cases where a(n) < sum(a(k),k=1..n-1) up to n=10^6. (End)

Examples

			Up to a(4)=16, we have a(n)=n^2.
But since 5^2=25=9+16 is already represented as sum of earlier terms, this is excluded, while a(5)=6^2=36 has the required property.
Obviously, any square larger to the sum of all preceding terms leads to enough new terms, thus a(n) <= floor( sqrt( sum(a(k),k=1..n-1))+1)^2.
But in contrast to A064934, such a simple formula (with equality) cannot be used here:
a(7)=12^2=144 < 147=sum(a(k),k<7) and also a(10)=sum(a(k),k<10)-84.
		

Crossrefs

Cf. A138857 (=sqrt(a(n))), A138000-138001, A064934.

Programs

  • PARI
    {s=1;p=0; for( n=1,20, until( !bitand( s, s>>(p^2) ), p++); s+=s<<(p^2); print1( p^2,","))}

Extensions

a(24)-a(30) from Donovan Johnson, Oct 03 2009
a(31) onwards from Martin Fuller, Apr 07 2025

A138856 Numbers such that all subsets of {prime(a(1)), ..., prime(a(n))} have a different sum.

Original entry on oeis.org

1, 2, 4, 5, 10, 16, 28, 47, 83, 147, 267, 481, 882, 1621, 2997, 5578, 10428, 19560, 36849, 69649, 131983, 250841, 477992, 912662, 1746404, 3347928, 6429526, 12366247, 23820901, 45947255, 88742186, 171594310, 332169919, 643674781, 1248523100, 2423948034
Offset: 1

Views

Author

M. F. Hasler, Apr 10 2008

Keywords

Comments

Crossrefs

Programs

  • PARI
    {s=1;p=0; for( n=1,20, until( !bitand( s, s>>prime(p++) ),); s+=s<
    				

Formula

a(n) = primepi(A138000(n)).

Extensions

a(22)-a(30) from Donovan Johnson, Oct 03 2009
a(31)-a(36) from Amiram Eldar, Sep 06 2024
Showing 1-3 of 3 results.