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

A005228 Sequence and first differences (A030124) together list all positive numbers exactly once.

Original entry on oeis.org

1, 3, 7, 12, 18, 26, 35, 45, 56, 69, 83, 98, 114, 131, 150, 170, 191, 213, 236, 260, 285, 312, 340, 369, 399, 430, 462, 495, 529, 565, 602, 640, 679, 719, 760, 802, 845, 889, 935, 982, 1030, 1079, 1129, 1180, 1232, 1285, 1339, 1394, 1451, 1509, 1568, 1628, 1689
Offset: 1

Views

Author

Keywords

Comments

This is the lexicographically earliest sequence that together with its first differences (A030124) contains every positive integer exactly once.
Hofstadter introduces this sequence in his discussion of Scott Kim's "FIGURE-FIGURE" drawing. - N. J. A. Sloane, May 25 2013
A225850(a(n)) = 2*n-1, cf. A167151. - Reinhard Zumkeller, May 17 2013
In view of the definition of A075326: start with a(0) = 0, and extend by rule that the next term is the sum of the predecessor and the most recent non-member of the sequence. - Reinhard Zumkeller, Oct 26 2014

Examples

			Sequence reads 1 3 7 12 18 26 35 45..., differences are 2 4 5, 6, 8, 9, 10 ... and the point is that every number not in the sequence itself appears among the differences. This property (together with the fact that both the sequence and the sequence of first differences are increasing) defines the sequence!
		

References

  • E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 73.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A030124 (complement), A037257, A056731, A056738, A140778, A225687.
Cf. A225850, A232746, A232747 (inverse), A232739, A232740, A232750 and also permutation pair A232751/A232752 constructed from this sequence and its complement.
Cf. A001651 (analog with sums instead of differences), A121229 (analog with products).
The same recurrence a(n) = a(n-1) + c(n-1) with different starting conditions: A061577 (starting with 2), A022935 (3), A022936 (4), A022937 (5), A022938 (6).
Related recurrences:
a(n-1) + c(n+1) - A022953, A022954.
a(n-1) + c(n) - A022946 to A022952.
a(n-1) + c(n-2) - A022940, A022941.
a(n-2) + c(n-1) - A022942 to A022944.
a(n-2) + c(n-2) - A022939.
a(n-3) + c(n-3) - A022955.
a(n-4) + c(n-4) - A022956.
a(n-5) + c(n-5) - A022957.

Programs

  • Haskell
    a005228 = scanl (+) 1 a030124
    a030124 = go 1 a005228 where go x ys | x < head ys = x     : go (x + 1) ys
                                         | otherwise   = x + 1 : go (x + 2) (tail ys)
    -- Maks Verver, Jun 30 2025
    
  • Maple
    maxn := 5000; h := array(1..5000); h[1] := 1; a := [1]; i := 1; b := []; for n from 2 to 1000 do if h[n] <> 1 then b := [op(b), n]; j := a[i]+n; if j < maxn then a := [op(a),j]; h[j] := 1; i := i+1; fi; fi; od: a; b; # a is A005228, b is A030124.
    A030124 := proc(n)
        option remember;
        local a,fnd,t ;
        if n <= 1 then
            op(n+1,[2,4]) ;
        else
            for a from procname(n-1)+1 do
                fnd := false;
                for t from 1 to n+1 do
                    if A005228(t)  = a then
                        fnd := true;
                        break;
                    end if;
                end do:
                if not fnd then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    A005228 := proc(n)
        option remember;
        if n <= 2 then
            op(n,[1,3]) ;
        else
            procname(n-1)+A030124(n-2) ;
        end if;
    end proc: # R. J. Mathar, May 19 2013
  • Mathematica
    a = {1}; d = 2; k = 1; Do[ While[ Position[a, d] != {}, d++ ]; k = k + d; d++; a = Append[a, k], {n, 1, 55} ]; a
    (* Second program: *)
    (* Program from Larry Morris, Jan 19 2017: *)
    d = 3; a = {1, 3, 7, 12, 18}; While[ Length[a = Join[a, a[[-1]] + Accumulate[Range[a[[d]] + 1, a[[++d]] - 1]]]] < 50]; a
    (* Comment: This adds as many terms to the sequence as there are numbers in each set of sequential differences. Consequently, the list of numbers it produces may be longer than the limit provided. With the limit of 50 shown, the sequence produced has length 60. *)
  • PARI
    A005228(n,print_all=0,s=1,used=0)={while(n--,used += 1<M. F. Hasler, Feb 05 2013

Formula

a(n) = a(n-1) + c(n-1) for n >= 2, where a(1)=1, a( ) increasing, c( ) = complement of a( ) (c is the sequence A030124).
Let a(n) = this sequence, b(n) = A030124 prefixed by 0. Then b(n) = mex{ a(i), b(i) : 0 <= i < n}, a(n) = a(n-1) + b(n) + 1. (Fraenkel)
a(1) = 1, a(2) = 3; a( ) increasing; for n >= 3, if a(q) = a(n-1)-a(n-2)+1 for some q < n then a(n) = a(n-1) + (a(n-1)-a(n-2)+2), otherwise a(n) = a(n-1) + (a(n-1)-a(n-2)+1). - Albert Neumueller (albert.neu(AT)gmail.com), Jul 29 2006
a(n) = n^2/2 + n^(3/2)/(3*sqrt(2)) + O(n^(5/4)) [proved in Jubin link]. - Benoit Jubin, May 13 2015
For all n >= 1, A232746(a(n)) = n and A232747(a(n)) = n. [Both sequences work as left inverses of this sequence.] - Antti Karttunen, May 14 2015

Extensions

Additional comments from Robert G. Wilson v, Oct 24 2001
Incorrect formula removed by Benoit Jubin, May 13 2015

A318948 Number of ways to choose an integer partition of each factor in a factorization of n.

Original entry on oeis.org

1, 2, 3, 9, 7, 17, 15, 40, 39, 56, 56, 126, 101, 165, 197, 336, 297, 496, 490, 774, 837, 1114, 1255, 1948, 2007, 2638, 3127, 4123, 4565, 6201, 6842, 9131, 10311, 12904, 14988, 19516, 21637, 26995, 31488, 39250, 44583, 55418, 63261, 77683, 89935, 108068, 124754
Offset: 1

Views

Author

Gus Wiseman, Sep 05 2018

Keywords

Examples

			The a(4) = 9 ways: (1+1)*(1+1), (1+1+1+1), (1+1)*(2), (2)*(1+1), (2+1+1), (2)*(2), (2+2), (3+1), (4).
		

Crossrefs

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[(Prepend[#1,d]&)/@Select[facs[n/d],Min@@#1>=d&],{d,Rest[Divisors[n]]}]];
    Table[Sum[Times@@PartitionsP/@fac,{fac,facs[n]}],{n,10}]

Formula

Dirichlet g.f.: Product_{n > 1} 1 / (1 - P(n) / n^s) where P = A000041. [clarified by Ilya Gutkovskiy, Oct 26 2019]

A286290 A bisection of A064736.

Original entry on oeis.org

1, 6, 12, 20, 35, 56, 72, 90, 110, 143, 182, 210, 240, 272, 306, 342, 399, 462, 506, 552, 600, 650, 702, 756, 812, 870, 930, 992, 1056, 1122, 1224, 1332, 1406, 1482, 1560, 1640, 1722, 1806, 1892, 1980, 2070, 2162, 2256, 2352, 2450, 2550, 2652, 2756, 2862, 2970, 3135, 3306, 3422, 3540
Offset: 1

Views

Author

N. J. A. Sloane, May 23 2017

Keywords

Comments

The terms of A064736 lie on two (curved) lines; this is one of them.
To produce this set, start with S={1} and a counter c=2, then repeatedly add to S the element c*increment(c), where increment() adds 1 or 2 in case c+1 is already in S. - M. F. Hasler, May 23 2017
Alternate definition: {1} and numbers of the form m(m+1) if neither m nor m+1 is an earlier term, or (m-1)(m+1), if m > 1 is a term of the sequence. - M. F. Hasler, May 23 2017
By definition, complement of A286291. - David A. Corneth, May 25 2017
If the initial 1 is omitted, this is the complement of A121229. - N. J. A. Sloane, May 26 2017

Crossrefs

Programs

  • PARI
    A286290_list(Nmax,a=List(1),c=2)={while(#aM. F. Hasler, May 23 2017
    
  • PARI
    a(n) = my(r = 1); for(i = 2, n, r = nxt(r)); r
    is(n) = if(n < 6, return(n==1)); if(issquare(n+1, &n), is(n), if(sqrtint(4*n+1)^2 == 4*n+1, s = sqrtint(4*n+1); !(is(s\2) || is(s\2+1)), return(0)))
    nxt(n) = n==1&&return(6); if(issquare(n+1, &n), (n+1) * (n+2), my(m = sqrtint(n)); if(is(m + 2), (m + 1) * (m + 3), (m + 1) * (m + 2)))
    lista(n) = my(c = 1, l = List([1])); for(i=2, n, c = nxt(c); listput(l, c)); l \\ David A. Corneth, May 25 2017

Formula

a(n) ~ n^2*(1 + 1.5/n^c) with c=1/2. (Conjectured, although for small n around 10^5 a smaller c ~ 0.478 is a better fit to the data.) - M. F. Hasler, May 23 2017
For n around 10^8, c ~ 0.4848 is a better fit. - David A. Corneth, May 25 2017

A286291 A bisection of A064736.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85
Offset: 1

Views

Author

N. J. A. Sloane, May 23 2017

Keywords

Comments

The terms of A064736 lie on two (curved) lines; this is one of them.
Sequence is: a(1) = 2, a(2) = 3. m is in the sequence if and only if there is no i such that a(i) * a(i+1) = m, where i are indices of terms in the sequence so far. By definition, this is the complement of A286090. - David A. Corneth, May 25 2017
Apparently the same as A121229 shifted by one place. - R. J. Mathar, May 25 2017

Examples

			See comments: 4 is in the sequence, since the terms so far, 2 and 3, don't multiply to 4. Same for 5. Sequence so far is: 2, 3, 4, 5. 6 isn't in the sequence. 7 is. Carrying on we get 2, 3, 4, 5, 7, 8, 9, 10, 11. 12 isn't in the sequence. Further in the sequence, 30 is in the sequence though it's of the form k*(k+1) for k = 5. But 6 isn't in the sequence. And indeed, 5 and 7 are consecutive terms so 5*7 = 35 isn't in the sequence. - _David A. Corneth_, May 25 2017
		

Crossrefs

Programs

  • PARI
    upto(n) = {my(l=List([2,3]), i = 1, p = 6, op = 3);
    while(1, if(op>=n, return(l)); for(j=op + 1, p-1, listput(l, j)); i++; op = p; p = l[i]*l[i+1])}
    is(n) = !is_A286290(n)
    is_A286290(n) = if(n < 6, return(n==1)); if(issquare(n+1, &n), is(n), if(sqrtint(4*n+1)^2 == 4*n+1, s = sqrtint(4*n+1); !(is(s\2) || is(s\2+1)), return(0))) \\ David A. Corneth, May 25 2017

A121260 Beginning with a(1)=0, take a(n) to be the smallest number not equal to the product of two consecutive (not distinct) earlier terms.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 5, 5, 7, 7, 8, 8, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42
Offset: 1

Views

Author

Giovanni Teofilatto, Aug 23 2006

Keywords

Comments

Apparently the definition is: a(1)=0. For even n, a(n)=a(n-1). For odd n, a(n) is the smallest value > a(n-1) which is not equal to some product a(i)*a(i-1) of two consecutive earlier terms. - R. J. Mathar, Jun 21 2021

Crossrefs

Cf. A121229.

Extensions

Offset corrected. - R. J. Mathar, Jun 20 2021
Showing 1-5 of 5 results.