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-10 of 21 results. Next

A377898 A121053 sorted into increasing order, or, equivalently, the indices of prime terms in A121053.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 27, 29, 30, 31, 33, 35, 37, 38, 40, 41, 43, 44, 46, 47, 49, 51, 53, 54, 56, 58, 59, 61, 62, 64, 66, 67, 69, 71, 72, 73, 75, 77, 79, 80, 82, 83, 85, 87, 89, 90, 92, 94, 96, 97, 99, 101, 102, 103, 105, 107, 108, 109, 111, 113, 114, 116, 118, 120, 122, 124, 126, 127, 129, 131, 132, 134, 136, 137, 139
Offset: 1

Views

Author

N. J. A. Sloane, Nov 14 2024

Keywords

Comments

That the two definitions produce the same values is a consequence of the definition of A121053.

Crossrefs

Cf. A121053.
Complement of A099862.

A377900 After A121053(n) has been found, a(n) is the smallest candidate for A121053(n+1) that has not been eliminated.

Original entry on oeis.org

1, 1, 1, 6, 6, 9, 9, 9, 12, 12, 12, 15, 15, 15, 18, 18, 18, 21, 21, 21, 24, 24, 24, 26, 26, 28, 28, 32, 32, 32, 32, 34, 34, 36, 36, 39, 39, 39, 42, 42, 42, 45, 45, 45, 48, 48, 48, 50, 50, 52, 52, 55, 55, 55, 57, 57, 60, 60, 60, 63, 63, 63, 65, 65, 68, 68, 68, 70
Offset: 1

Views

Author

N. J. A. Sloane, Nov 14 2024

Keywords

Examples

			After a(8) = 9, and A121053(9) = 10 has been determined, the smallest prime not yet used is 17 and the smallest composite not yet used or eliminated is 12 (10 is now eliminated because the terms of A121053 must be distinct), so a(9) = 12.
		

Crossrefs

Programs

  • PARI
    lista(nn) = my(c=4, t=0); print1("1, 1, 1"); forcomposite(k=4, nn, if(t%2, for(n=c, k-1, print1(", ", k)); c=k); t++); \\ Jinyuan Wang, Nov 29 2024
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def nextcomposite(n): return next(k for k in count(n+1) if not isprime(k))
    def agen(): # generator of terms
        yield from [1, 1, 1]
        c, c2 = 4, 6
        for n in count(4):
            if n == c2: c, c2 = c2, nextcomposite(nextcomposite(c2))
            yield c2
    print(list(islice(agen(), 70))) # Michael S. Branicky, Nov 29 2024

Formula

a(n) = A099862(k+1) for A099862(k) <= n < A099862(k+1). - Jinyuan Wang, Nov 29 2024

Extensions

More terms from Jinyuan Wang, Nov 29 2024

A379050 a(n) = b(b(n)), where b(k) = A121053(k).

Original entry on oeis.org

1, 3, 5, 7, 2, 11, 13, 19, 23, 17, 37, 41, 29, 53, 67, 31, 73, 89, 43, 103, 107, 47, 127, 139, 59, 163, 61, 167, 71, 191, 197, 211, 79, 229, 83, 241, 97, 263, 283, 101, 307, 313, 109, 331, 347, 113, 353, 401, 131, 419, 137, 439, 149, 443, 479, 151, 487, 157, 509, 541, 173, 563, 577, 179, 601, 181, 607, 643, 193, 647, 199, 661, 673, 727, 223, 761, 227, 787, 233, 797, 821, 239
Offset: 1

Views

Author

N. J. A. Sloane, Dec 14 2024

Keywords

Comments

Suggested by the formula a(a(n)) = 2*n + 3 for the analogous sequence A079000.

Crossrefs

Programs

  • Mathematica
    nn = 2^8; a[1] = 2; u = 4; v = {1}; w = {2}; p = 3;
    Do[If[MemberQ[w, n], k = p;
      w = Append[DeleteCases[w, n], p]; p = NextPrime[p],
      If[Length[v] == 0,
        k = u; AppendTo[w, u],
        k = First[v]; v = Rest[v]]];
      Set[{a[n]}, {k}];
      If[n + 1 >= u, u++; While[PrimeQ[u], u++]], {n, 2, nn}];
    {1}~Join~TakeWhile[Array[a[a[#]] &, nn], IntegerQ] (* Michael De Vlieger, Dec 17 2024 *)

A079000 a(n) is taken to be the smallest positive integer greater than a(n-1) which is consistent with the condition "n is a member of the sequence if and only if a(n) is odd".

Original entry on oeis.org

1, 4, 6, 7, 8, 9, 11, 13, 15, 16, 17, 18, 19, 20, 21, 23, 25, 27, 29, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, 97
Offset: 1

Views

Author

Matthew Vandermast, Feb 01 2003

Keywords

Comments

a(a(n)) = 2n + 3 for n>1.

Examples

			a(2) cannot be 2 because 2 is even; it cannot be 3 because that would require 2 to be a member of the sequence. Hence a(2)=4 and the next odd member of the sequence is the fourth member.
		

References

  • Hsien-Kuei Hwang, S Janson, TH Tsai, Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications, Preprint, 2016; http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf. Also Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585
  • N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.

Crossrefs

Partial sums give A080566. Differences give A079948.

Programs

  • Maple
    Digits := 50; A079000 := proc(n) local k,j; if n<=2 then n^2; else k := floor(evalf(log( (n+3)/6 )/log(2)) ); j := n-(9*2^k-3); 12*2^k-3+3*j/2 +abs(j)/2; fi; end;
    A002264 := n->floor(n/3): A079944 := n->floor(log[2](4*(n+2)/3))-floor(log[2](n+2)): A000523 := n->floor(log[2](n)): f := n->A079944(A002264(n-4)): g := n->A000523(A002264(n+2)/2): A079000 := proc(n) if n>3 then RETURN(simplify(3*n+3-3*2^g(n)+(-1)^f(n)*(9*2^g(n)-n-3))/2) else if n>0 then RETURN([1,4,6][n]) else RETURN(0) fi fi: end;
  • Mathematica
    a[1] = 1; a[n_] := (k = Floor[Log[2, (n+3)/6]]; j = n-(9*2^k - 3); 12*2^k-3 + 3*j/2 + Abs[j]/2); Table[a[n], {n, 1, 71}] (* Jean-François Alcover, May 21 2012, after Maple *)

Formula

a(1) = 1, a(2) = 4, then a(9*2^k-3+j) = 12*2^k-3+3*j/2+|j|/2 for k>=0, -3*2^k <= j <= 3*2^k. Also a(3n) = 3*b(n/3), a(3n+1) = 2*b(n)+b(n+1), a(3n+2) = b(n)+2*b(n+1) for n>=2, where b = A079905. - N. J. A. Sloane and Benoit Cloitre, Feb 20 2003
a(n+1) - 2*a(n) + a(n-1) = 1 for n = 9*2^k - 3, k>=0, = -1 for n = 2 and 3*2^k-3, k>=1 and = 0 otherwise.
a(n) = (3*n + 3 - 3*2^g(n) + (-1)^f(n)*(9*2^g(n) - n - 3))/2 for n>3, f(n) = A079944(A002264(n-4)) and g(n) = A000523(A002264(n+2)/2). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 23 2003
Also a(n) = n + 3*2^A000523(A002264(n+2)/2)*(1 - 3*A080584(n-4)) + A080584(n-4)*(n+3) for n>3, where A080584(n)=A079944(A002264(n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 24 2003

A105753 Lexicographically earliest sequence of positive integers with the property that a(a(n)) = a(1)+a(2)+...+a(n).

Original entry on oeis.org

1, 3, 4, 8, 6, 22, 9, 16, 53, 11, 133, 13, 279, 15, 573, 69, 18, 1233, 20, 2486, 23, 44, 4995, 25, 10059, 27, 20145, 29, 40319, 31, 80669, 33, 161371, 35, 322777, 37, 645591, 39, 1291221, 41, 2582483, 43, 5165009, 5039, 46, 10335103, 48
Offset: 1

Views

Author

Eric Angelini, Aug 13 2006

Keywords

Comments

The Fibonacci 9-step numbers referenced in the Noe-Post paper are in A104144. - T. D. Noe, Oct 27 2008

Examples

			Sequence reads from the beginning:
- at position a(1)=1 we see the sum of all previously written terms [indeed, nil + 1=1]
- at position a(2)=3 we see the sum of all previously written terms [indeed, 1+ 3=4]
- at position a(3)=4 we see the sum of all previously written terms [indeed, 1+3+4=8]
- at position a(4)=8 we see the sum of all previously written terms [indeed, 1+3+4+8=16]
- at position a(5)=6 we see the sum of all previously written terms [indeed, 1+3+4+8+6=22]
- at position a(6)=22 we see the sum of all previously written terms [indeed, 1+3+4+8+6+22=44 and 44 is the 22nd term of S]
etc.
		

Crossrefs

Extensions

More terms from Max Alekseyev, Aug 14 2006
Edited by Max Alekseyev, Mar 08 2015

A377901 Let Q consist of 1 together with the primes (A008578); form the lexicographically earliest infinite sequence S of distinct positive numbers with the property that a(k) is in Q if and only if k is a term in S.

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 11, 9, 13, 12, 17, 19, 23, 15, 29, 18, 31, 37, 41, 21, 43, 24, 47, 53, 26, 59, 28, 61, 67, 32, 71, 73, 34, 79, 36, 83, 89, 39, 97, 42, 101, 103, 107, 45, 109, 48, 113, 127, 50, 131, 52, 137, 139, 55, 149, 57, 151, 60, 157, 163, 167, 63, 173, 65
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2024

Keywords

Comments

In the early 20th century, 1 was regarded as a prime (see A008578). The present sequence is therefore a 20th-century analog of A121053. That is, the sequence answers the question "Which terms are in Q?", and is the lexicographically earliest answer. See A121053 for further information.
Like A121053, this is an example of a "Lexicographically Earliest Sequence" for which there is a greedy algorithm: no backtracking is needed.
Theorem. Let p(k) = k-th prime, c(k) = k-th composite number. For n >= 7, if n is a prime or n = c(2*t) for some t, then a(n) = p(k) where k = floor((n+PrimePi(n)-1)/2); otherwise, n = c(2*t-1) for some t and a(n) = c(2*t).

Examples

			1 is the smallest possible choice for a(1), and 1 is in Q, and it turns out that there is no contradiction in choosing a(1) = 1.
After a(5) = 7, 4 is the smallest number not yet in the sequence, and a(4) = 5 is in Q, so we can try a(6) = 4 (and it turns out that this does not lead to a contradiction later).
		

References

  • N. J. A. Sloane, The Remarkable Sequences of Éric Angelini, MS in preparation, December 2024.

Crossrefs

Programs

  • Mathematica
    nn = 120; u = 4; v = {}; w = {}; c = 2;
    {1}~Join~Reap[Do[
      If[MemberQ[w, n], k = c;
        w = DeleteCases[w, n],
        m = Min[{c, u, v}];
        If[And[PrimeQ[m], n < m],
          AppendTo[v, n]];
          If[Length[v] > 0, If[v[[1]] == m, v = Rest[v]]]; k = m];
        AppendTo[w, k]; If[k == c, c++; While[CompositeQ[c], c++]]; Sow[k];
    If[n + 1 >= u, u++; While[PrimeQ[u], u++]], {n, 2, nn}] ][[-1, 1]] (* Michael De Vlieger, Dec 17 2024 *)

Extensions

More terms from Michael De Vlieger, Dec 17 2024

A080032 a(n) is taken to be the smallest positive integer not already present which is consistent with the condition "n is a member of the sequence if and only if a(n) is even".

Original entry on oeis.org

0, 2, 4, 1, 6, 7, 8, 10, 12, 11, 14, 16, 18, 15, 20, 22, 24, 19, 26, 28, 30, 23, 32, 34, 36, 27, 38, 40, 42, 31, 44, 46, 48, 35, 50, 52, 54, 39, 56, 58, 60, 43, 62, 64, 66, 47, 68, 70, 72, 51, 74, 76, 78, 55, 80, 82, 84, 59, 86, 88, 90, 63, 92, 94, 96, 67, 98, 100, 102, 71, 104
Offset: 0

Views

Author

N. J. A. Sloane, Mar 14 2003

Keywords

Comments

The same sequence, but without the initial 0, obeys the rule: "The concatenation of a(n) and a(a(n)) is even". Example: "2" and the 2nd term, concatenated, is 24; "4" and the 4th term, concatenated, is 46; "1" and the 1st term, concatenated, is 12; etc. - Eric Angelini, Feb 22 2017
If "even" in the definition is replaced by "prime", we get A121053. - N. J. A. Sloane, Dec 14 2024

Crossrefs

Cf. A079000, A080029, A080030, A121053. Equals A079313 - 1.

Programs

  • Mathematica
    CoefficientList[Series[x*(-3*x^10 + 2*x^9 - x^8 + 8*x^6 + 3*x^4 + 6*x^3 + x^2 + 4*x + 2)/(x^8 - 2*x^4 + 1), {x, 0, 120}], x] (* Michael De Vlieger, Dec 17 2024 *)

Formula

For n >= 4 a(n) is given by: a(4m)=6m, a(4m+1)=4m+3, a(4m+2)=6m+2, a(4m+3)=6m+4.
From Chai Wah Wu, Apr 13 2024: (Start)
a(n) = 2*a(n-4) - a(n-8) for n > 11.
G.f.: x*(-3*x^10 + 2*x^9 - x^8 + 8*x^6 + 3*x^4 + 6*x^3 + x^2 + 4*x + 2)/(x^8 - 2*x^4 + 1). (End)

Extensions

More terms from Matthew Vandermast, Mar 21 2003

A085925 a(n) is taken to be the smallest positive integer greater than a(n-1) which is consistent with the condition "n is a member of the sequence if and only if a(n) is not prime".

Original entry on oeis.org

1, 3, 4, 6, 7, 8, 9, 10, 12, 14, 17, 18, 19, 20, 23, 29, 30, 32, 33, 34, 37, 41, 42, 43, 47, 53, 59, 61, 62, 63, 67, 68, 69, 70, 71, 73, 74, 79, 83, 89, 90, 91, 92, 97, 101, 103, 104, 107, 109, 113, 127, 131, 132, 137, 139, 149, 151, 157, 158, 163, 164, 165, 166, 167, 173
Offset: 1

Views

Author

David Wasserman, Aug 16 2003

Keywords

Examples

			a(4) = 6 because 4 is in the sequence and 6 is the next nonprime after a(3). a(5) = 7 because 5 is not in the sequence and 7 is the next prime after a(4).
		

Crossrefs

A companion to A121053.

A121173 Sequence S with property that for n in S, a(n) = a(1) + a(2) +...+ a(n-1) and for n not in S, a(n) = n+1.

Original entry on oeis.org

2, 2, 4, 8, 6, 22, 8, 52, 10, 114, 12, 240, 14, 494, 16, 1004, 18, 2026, 20, 4072, 22, 8166, 24, 16356, 26, 32738, 28, 65504, 30, 131038, 32, 262108, 34, 524250, 36, 1048536, 38, 2097110, 40, 4194260, 42, 8388562, 44, 16777168, 46, 33554382
Offset: 1

Views

Author

Max Alekseyev, Aug 15 2006

Keywords

Comments

a(1)=1 cannot happen, so the sequence S starts with a(1)=2.
Note that a(n)=a(1)+a(2)+...+a(n-1) can hold even if n is not in S. The smallest example is n=3.
All terms are even. - Reinhard Zumkeller, Nov 06 2013

Crossrefs

Programs

  • Haskell
    a121173 n = a121173_list !! (n-1)
    a121173_list = f 1 [] where
       f x ys = y : f (x + 1) (y : ys) where
         y = if x `elem` ys then sum ys else x + 1
    -- Reinhard Zumkeller, Nov 06 2013
    
  • Mathematica
    s={2};Do[If[MemberQ[s,n],m=Total[s],m=n+1];AppendTo[s,m],{n,2,46}];s (* James C. McMahon, Oct 13 2024 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        S, s, an = {2}, 2, 2
        for n in count(2):
            yield an
            an = s if n in S else n+1
            s += an
            S.add(an)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Oct 13 2024

Formula

a(2*n) = A145654(n+1). - Reinhard Zumkeller, Nov 06 2013
a(2*n+1) = 2*n+2.
From Colin Barker, Jan 30 2016: (Start)
a(n) = 2*(2^(n/2+1)-2)-n for n even.
a(n) = n+1 for n odd.
a(n) = -a(n-1)+3*a(n-2)+3*a(n-3)-2*a(n-4)-2*a(n-5) for n>5.
G.f.: 2*x*(1+2*x) / ((1-x)*(1+x)^2*(1-2*x^2)). (End)
E.g.f.: (x - 4)*cosh(x) + 4*cosh(sqrt(2)*x) + (1 - x)*sinh(x). - Stefano Spezia, Oct 14 2024

A121174 Sequence S with property (making all terms distinct) that (i) a(1)=3, (ii) for n is S, a(n)=a(1)+a(2)+...+a(n-1), (iii) for n not in S, a(n)=the smallest number different from a(1), ..., a(n-1) not breaking condition (ii).

Original entry on oeis.org

3, 4, 7, 14, 6, 34, 68, 9, 145, 11, 301, 13, 615, 1230, 16, 2476, 18, 4970, 20, 9960, 22, 19942, 24, 39908, 26, 79842, 28, 159712, 30, 319454, 32, 638940, 35, 1277915, 2555830, 37, 5111697, 39, 10223433, 41, 20446907, 43, 40893857, 45
Offset: 1

Views

Author

Max Alekseyev, Aug 15 2006

Keywords

Crossrefs

Showing 1-10 of 21 results. Next