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

A033627 0-additive sequence: not the sum of any previous pair.

Original entry on oeis.org

1, 2, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175
Offset: 1

Views

Author

Keywords

Comments

Conjecture: a(n+1) is the number of distinct numbers of steps required for the last n digits of integers to repeat themselves by iterating the map m -> m^2 + 1. - Ya-Ping Lu, Oct 19 2021

References

  • R. K. Guy, Unsolved Problems in Number Theory, C4

Crossrefs

See A244151 for another version.

Programs

  • Haskell
    import Data.List ((\\))
    a033627 n = a033627_list !! (n-1)
    a033627_list = f [1..] [] where
       f (x:xs) ys = x : f (xs \\ (map (+ x) ys)) (x:ys)
    -- Reinhard Zumkeller, Jan 11 2012
    
  • Mathematica
    Join[{1,2},Range[4,200,3]] (* Vladimir Joseph Stephan Orlovsky, Jan 27 2012 *)
    f[s_List] := Block[{k = s[[-1]] + 1, ss = Union[ Plus @@@ Subsets[s, {2}]]}, While[ MemberQ[ ss, k], k++]; Append[ s, k]]; Nest[f, {1}, 70] (* Robert G. Wilson v, Jun 23 2014 *)
    CoefficientList[Series[x(1+x^2+x^3)/(1-x)^2 , {x, 0, 70}], x] (* Stefano Spezia, Oct 04 2018 *)
  • PARI
    a(n)=if(n>2,3*n-5,n) \\ Charles R Greathouse IV, Sep 01 2016
    
  • Python
    def a(n): return 3*n-5 if n > 2 else n
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Jun 09 2025

Formula

2 together with numbers of form 3k+1 (A016777).
From Gary W. Adamson, May 10 2008: (Start)
Equals binomial transform of [1, 1, 1, 0, -1, 2, -3, 4, -5, 6, -7, ...].
Equals sum of antidiagonal terms of the following arithmetic array: 1, 1, 1, 1, 1, ... 1, 2, 3, 4, 5, ... 1, 3, 5, 7, 9, ... . (End)
From Colin Barker, Sep 19 2012: (Start)
a(n) = 3*n - 5, for n > 2.
a(n) = 2*a(n-1) - a(n-2), for n > 4;
G.f.: x*(1+x^2+x^3)/(1-x)^2. (End)
E.g.f.: 5 + 3*x + x^2/2 + exp(x)*(3*x - 5). - Stefano Spezia, Apr 15 2023

A025582 A B_2 sequence: a(n) is the least value such that sequence increases and pairwise sums of elements are all distinct.

Original entry on oeis.org

0, 1, 3, 7, 12, 20, 30, 44, 65, 80, 96, 122, 147, 181, 203, 251, 289, 360, 400, 474, 564, 592, 661, 774, 821, 915, 969, 1015, 1158, 1311, 1394, 1522, 1571, 1820, 1895, 2028, 2253, 2378, 2509, 2779, 2924, 3154, 3353, 3590, 3796, 3997, 4296, 4432, 4778, 4850
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the least value such that sequence increases and pairwise differences of distinct elements are all distinct.

Examples

			After 0, 1, a(3) cannot be 2 because 2+0 = 1+1, so a(3) = 3.
		

Crossrefs

Row 2 of A365515.
See A011185 for more information.
A010672 is a similar sequence, but there the pairwise sums of distinct elements are all distinct.

Programs

  • Python
    from itertools import count, islice
    def A025582_gen(): # generator of terms
        aset1, aset2, alist = set(), set(), []
        for k in count(0):
            bset2 = {k<<1}
            if (k<<1) not in aset2:
                for d in aset1:
                    if (m:=d+k) in aset2:
                        break
                    bset2.add(m)
                else:
                    yield k
                    alist.append(k)
                    aset1.add(k)
                    aset2 |= bset2
    A025582_list = list(islice(A025582_gen(),20)) # Chai Wah Wu, Sep 01 2023
  • Sage
    def A025582_list(n):
        a = [0]
        psums = set([0])
        while len(a) < n:
            a += [next(k for k in IntegerRange(a[-1]+1, infinity) if not any(i+k in psums for i in a+[k]))]
            psums.update(set(i+a[-1] for i in a))
        return a[:n]
    print(A025582_list(20))
    # D. S. McNeil, Feb 20 2011
    

Formula

a(n) = A005282(n) - 1. - Tyler Busby, Mar 16 2024

A011185 A B_2 sequence: a(n) = least value such that sequence increases and pairwise sums of distinct elements are all distinct.

Original entry on oeis.org

1, 2, 3, 5, 8, 13, 21, 30, 39, 53, 74, 95, 128, 152, 182, 212, 258, 316, 374, 413, 476, 531, 546, 608, 717, 798, 862, 965, 1060, 1161, 1307, 1386, 1435, 1556, 1722, 1834, 1934, 2058, 2261, 2497, 2699, 2874, 3061, 3197, 3332, 3629, 3712, 3868, 4140, 4447, 4640
Offset: 1

Views

Author

Keywords

Comments

a(n) = least positive integer > a(n-1) and not equal to a(i)+a(j)-a(k) for distinct i and j with 1 <= i,j,k <= n-1. [Comment corrected by Jean-Paul Delahaye, Oct 02 2020.]

Crossrefs

Programs

  • Python
    from itertools import islice
    def agen(): # generator of terms
        aset, sset, k = set(), set(), 0
        while True:
            k += 1
            while any(k+an in sset for an in aset): k += 1
            yield k; sset.update(k+an for an in aset); aset.add(k)
    print(list(islice(agen(), 51))) # Michael S. Branicky, Feb 05 2023

Formula

a(n) = A010672(n-1)+1.

A062295 A B_2 sequence: a(n) is the smallest square such that pairwise sums of not necessarily distinct elements are all distinct.

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 64, 81, 100, 169, 256, 289, 441, 484, 576, 625, 841, 1089, 1296, 1444, 1936, 2025, 2401, 2601, 3136, 4225, 4356, 4624, 5329, 5476, 5776, 6084, 7569, 9025, 10201, 11449, 11664, 12321, 12996, 13456, 14400, 16129, 17956, 20164, 22201
Offset: 1

Views

Author

Labos Elemer, Jul 02 2001

Keywords

Examples

			36 is in the sequence since the pairwise sums of {1, 4, 9, 16, 25, 36} are all distinct: 2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, 34, 37, 40, 41, 45, 50, 52, 61, 72.
49 is not in the sequence since 1 + 49 = 25 + 25.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A062295_gen(): # generator of terms
        aset1, aset2, alist = set(), set(), []
        for k in (n**2 for n in count(1)):
            bset2 = {k<<1}
            if (k<<1) not in aset2:
                for d in aset1:
                    if (m:=d+k) in aset2:
                        break
                    bset2.add(m)
                else:
                    yield k
                    alist.append(k)
                    aset1.add(k)
                    aset2 |= bset2
    A062295_list = list(islice(A062295_gen(),30)) # Chai Wah Wu, Sep 05 2023

Extensions

Edited, corrected and extended by Klaus Brockhaus, Sep 24 2007

A062294 A B_2 sequence: a(n) is the smallest prime such that the pairwise sums of distinct elements are all distinct.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 29, 47, 67, 83, 131, 163, 233, 307, 397, 443, 617, 727, 809, 941, 1063, 1217, 1399, 1487, 1579, 1931, 2029, 2137, 2237, 2659, 2777, 3187, 3659, 3917, 4549, 4877, 5197, 5471, 5981, 6733, 7207, 7349, 8039, 8291, 8543, 9283, 9689, 10037
Offset: 1

Views

Author

Labos Elemer, Jul 02 2001

Keywords

Crossrefs

Programs

  • Python
    from itertools import islice
    from sympy import nextprime
    def A062294_gen(): # generator of terms
        aset2, alist, k = set(), [], 0
        while (k:=nextprime(k)):
            bset2 = set()
            for a in alist:
                if (b:=a+k) in aset2:
                    break
                bset2.add(b)
            else:
                yield k
                alist.append(k)
                aset2.update(bset2)
    A062294_list = list(islice(A062294_gen(),30)) # Chai Wah Wu, Sep 11 2023

Extensions

Edited, corrected and extended by Klaus Brockhaus, Sep 17 2007

A133097 a(n) = A005282(n) - A011185(n-1).

Original entry on oeis.org

0, 0, 1, 3, 5, 8, 10, 15, 27, 28, 23, 28, 20, 30, 22, 40, 32, 45, 27, 62, 89, 62, 116, 167, 105, 118, 108, 51, 99, 151, 88, 137, 137, 265, 174, 195, 320, 321, 249, 283, 226, 281, 293, 394, 465, 369, 585, 565, 639, 404, 483, 221, 233, 428, 384, 370, 527, 431, 818
Offset: 1

Views

Author

Klaus Brockhaus, Sep 17 2007

Keywords

Comments

Also A025582(n) - A010672(n-1).
A005282 is the sequence of smallest numbers such that the pairwise sums of not necessarily distinct elements are all distinct, whereas A011185 is the sequence of smallest numbers such that the pairwise sums of distinct elements are all distinct.
Sequence has negative terms; the first one is a(65) = -130.

Examples

			a(6) = A005282(6) - A011185(6) = 21 - 13 = 8.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from collections import deque
    def A133097_gen(): # generator of terms
        aset2, alist, bset2, blist, aqueue, bqueue = set(), [], set(), [], deque(), deque()
        for k in count(1):
            cset2 = {k<<1}
            if (k<<1) not in aset2:
                for a in alist:
                    if (m:=a+k) in aset2:
                        break
                    cset2.add(m)
                else:
                    aqueue.append(k)
                    alist.append(k)
                    aset2.update(cset2)
            cset2 = set()
            for b in blist:
                if (m:=b+k) in bset2:
                    break
                cset2.add(m)
            else:
                bqueue.append(k)
                blist.append(k)
                bset2.update(cset2)
            if len(aqueue) > 0 and len(bqueue) > 0:
                yield aqueue.popleft()-bqueue.popleft()
    A133097_list = list(islice(A133097_gen(),30)) # Chai Wah Wu, Sep 11 2023

A062292 A B_2 sequence: a(n) is the smallest cube such that the pairwise sums of {a(1)...a(n)} are all distinct.

Original entry on oeis.org

1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 2197, 2744, 3375, 4913, 5832, 6859, 8000, 9261, 10648, 12167, 15625, 17576, 19683, 21952, 24389, 27000, 29791, 35937, 42875, 50653, 54872, 59319, 64000, 68921, 74088, 79507, 85184, 91125, 97336
Offset: 1

Views

Author

Labos Elemer, Jul 02 2001

Keywords

Comments

A Mian-Chowla sequence consisting only of cubes.

Examples

			During recursive construction of this set, for n=1-50, the cubes of 12,18,24,32,34,36,48 are left out to keep all sums of distinct cubes distinct from each other.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A062292_gen(): # generator of terms
        aset1, aset2, alist = set(), set(), []
        for k in (n**3 for n in count(1)):
            bset2 = {k<<1}
            if (k<<1) not in aset2:
                for d in aset1:
                    if (m:=d+k) in aset2:
                        break
                    bset2.add(m)
                else:
                    yield k
                    alist.append(k)
                    aset1.add(k)
                    aset2.update(bset2)
    A062292_list = list(islice(A062292_gen(),30)) # Chai Wah Wu, Sep 05 2023

A062559 A B2 sequence consisting of powers of primes but not primes: a(n) = least value from A025475 such that sequence increases and pairwise sums of distinct elements are all distinct.

Original entry on oeis.org

4, 8, 9, 16, 25, 27, 49, 64, 121, 243, 256, 343, 512, 729, 961, 1024, 1331, 1369, 1849, 2048, 2187, 2197, 2401, 3125, 3481, 4096, 4913, 5329, 6561, 6859, 6889, 8192, 10201, 12769, 14641, 15625, 16384, 16807, 19683, 22201, 22801, 27889, 28561, 29791, 32768
Offset: 0

Views

Author

Labos Elemer, Jul 03 2001

Keywords

Comments

32 is the first prime power > 1 not in this sequence.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import factorint
    def A062559_gen(): # generator of terms
        aset2, alist = set(), []
        for k in count(0):
            if len(f:=factorint(k).values()) == 1 and max(f) > 1:
                bset2 = set()
                for a in alist:
                    if (b:=a+k) in aset2:
                        break
                    bset2.add(b)
                else:
                    yield k
                    alist.append(k)
                    aset2.update(bset2)
    A062559_list = list(islice(A062559_gen(),30)) # Chai Wah Wu, Sep 11 2023

Extensions

More terms from Sean A. Irvine, Apr 03 2023
Showing 1-8 of 8 results.