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

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

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

A080029 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 a multiple of 3".

Original entry on oeis.org

0, 2, 3, 6, 5, 9, 12, 8, 15, 18, 11, 21, 24, 14, 27, 30, 17, 33, 36, 20, 39, 42, 23, 45, 48, 26, 51, 54, 29, 57, 60, 32, 63, 66, 35, 69, 72, 38, 75, 78, 41, 81, 84, 44, 87, 90, 47, 93, 96, 50, 99, 102, 53, 105, 108, 56, 111, 114, 59, 117, 120, 62, 123, 126, 65, 129, 132, 68
Offset: 0

Views

Author

N. J. A. Sloane, Mar 14 2003

Keywords

Crossrefs

Programs

  • Mathematica
    {#+1,2#-1,2#}[[Mod[ #,3,1]]]&/@Range[0,80]  (* Federico Provvedi, Jun 15 2021 *)
  • Python
    def a(n): m, r = divmod(n, 3); return 3*(2-r%2)*m + (r > 0)*(r+1)
    print([a(n) for n in range(68)]) # Michael S. Branicky, Jun 15 2021

Formula

a(3m)=6m, a(3m+1)=3m+2, a(3m+2)=6m+3.

Extensions

More terms from Matthew Vandermast, Mar 20 2003

A080030 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 congruent to 1 mod 3".

Original entry on oeis.org

2, 1, 4, 5, 7, 10, 8, 13, 16, 11, 19, 22, 14, 25, 28, 17, 31, 34, 20, 37, 40, 23, 43, 46, 26, 49, 52, 29, 55, 58, 32, 61, 64, 35, 67, 70, 38, 73, 76, 41, 79, 82, 44, 85, 88, 47, 91, 94, 50, 97, 100, 53, 103, 106, 56, 109, 112, 59, 115, 118, 62, 121, 124, 65, 127, 130, 68
Offset: 0

Views

Author

N. J. A. Sloane, Mar 14 2003

Keywords

Comments

A permutation of all positive non-multiples of 3. - Matthew Vandermast, Mar 21 2003

Crossrefs

Formula

a(3m)=3m+2, a(3m+1)=6m+1, a(3m+2)=6m+4.

Extensions

More terms from Matthew Vandermast, Mar 21 2003

A379051 Lexicographically earliest infinite sequence of distinct positive numbers with the property that n is a member of the sequence iff a(n) is composite.

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 10, 12, 14, 15, 7, 16, 17, 18, 20, 21, 22, 24, 23, 25, 26, 27, 28, 30, 32, 33, 34, 35, 31, 36, 38, 39, 40, 42, 44, 45, 41, 46, 48, 49, 50, 51, 47, 52, 54, 55, 56, 57, 58, 60, 62, 63, 59, 64, 65, 66, 68, 69, 70, 72, 67, 74, 75, 76, 77, 78, 80
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2024

Keywords

Comments

The sequence tells you exactly which terms of the sequence are composite: the second, fourth, fifth, sixth, etc. terms are composite, and this is the lexicographically earliest sequence with this property.
Let P be a property of the nonnegative integers, such as being a prime.
The OEIS contains many entries whose definitions have the following form.
"The sequence is the lexicographically earliest infinite sequence of distinct positive (or sometimes nonnegative) integers with the property that n is a term of the sequence iff a(n) has property P."
That is, the terms of the sequence tell you which terms of the sequence have the property. A121053 is the classical example.
Since these are lists, the offset is usually 1.
There are two versions, one where the sequence is required to be strictly increasing, and an unrestricted version which is not required to be increasing.
Examples:
Property P Unrestricted Increasing
----------------------------------------
Prime A121053 A079254, A334067 (offset 0)
Composite A379051 A099797
Not composite A377901 A099798
Not prime A379053 A085925

Crossrefs

Programs

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

Formula

When sorted, this appears to be the complement of [1, 3, 11, and prime(2*t), t >= 3]. - Scott R. Shannon, Dec 18 2024

Extensions

More terms from Michael De Vlieger, Dec 17 2024

A379053 Lexicographically earliest infinite sequence of distinct positive numbers with the property that n is a member of the sequence iff a(n) is not a prime.

Original entry on oeis.org

1, 3, 4, 6, 7, 8, 9, 10, 12, 14, 13, 15, 16, 18, 20, 21, 19, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 23, 36, 37, 38, 39, 40, 42, 44, 45, 46, 48, 49, 43, 50, 51, 52, 54, 55, 53, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 61, 70, 72, 74, 75, 76, 77, 78, 71
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2024

Keywords

Comments

The sequence tells you exactly which terms of the sequence are either 1 or composite.
See the Comments in A379051 for further information.

Crossrefs

Programs

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

Formula

When sorted, this appears to be the complement of [2, 5, 11, 17, 29, and prime(2*t+1), t >= 35]. - Scott R. Shannon, Dec 18 2024

Extensions

More terms from Michael De Vlieger, Dec 17 2024

A080031 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 congruent to 2 mod 3".

Original entry on oeis.org

1, 2, 5, 4, 8, 11, 7, 14, 17, 10, 20, 23, 13, 26, 29, 16, 32, 35, 19, 38, 41, 22, 44, 47, 25, 50, 53, 28, 56, 59, 31, 62, 65, 34, 68, 71, 37, 74, 77, 40, 80, 83, 43, 86, 89, 46, 92, 95, 49, 98, 101, 52, 104, 107, 55, 110, 113, 58, 116, 119, 61, 122, 125, 64, 128, 131, 67
Offset: 0

Views

Author

N. J. A. Sloane, Mar 14 2003

Keywords

Comments

A permutation of all positive non-multiples of 3; also a permutation of A080030. - Matthew Vandermast, Mar 21 2003

Crossrefs

Formula

a(3m)=3m+1, a(3m+1)=6m+2, a(3m+2)=6m+5. [corrected by Georg Fischer, Jun 08 2022]

Extensions

More terms from Matthew Vandermast, Mar 21 2003

A080033 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 a multiple of 4".

Original entry on oeis.org

0, 2, 4, 5, 8, 12, 7, 16, 20, 10, 24, 13, 28, 32, 15, 36, 40, 18, 44, 21, 48, 52, 23, 56, 60, 26, 64, 29, 68, 72, 31, 76, 80, 34, 84, 37, 88, 92, 39, 96, 100, 42, 104, 45, 108, 112, 47, 116, 120, 50, 124, 53, 128, 132, 55, 136, 140, 58, 144, 61, 148, 152, 63, 156, 160, 66
Offset: 0

Views

Author

N. J. A. Sloane, Mar 14 2003

Keywords

Crossrefs

Formula

a(8m)=20m, a(8m+1)=8m+2, a(8m+2)=20m+4, a(8m+3)=8m+5, a(8m+4)=20m+8, a(8m+5)=20m+12, a(8m+6)=8m+7, a(8m+7)=20m+16.
From Chai Wah Wu, Sep 27 2016: (Start)
a(n) = 2*a(n-8) - a(n-16) for n > 15.
G.f.: x*(4*x^14 + x^13 + 8*x^12 + 12*x^11 + 3*x^10 + 16*x^9 + 6*x^8 + 20*x^7 + 16*x^6 + 7*x^5 + 12*x^4 + 8*x^3 + 5*x^2 + 4*x + 2)/(x^16 - 2*x^8 + 1). (End)

Extensions

More terms from Matthew Vandermast, Mar 23 2003

A334067 a(n) is taken to be the smallest positive integer greater than a(n-1) which is consistent with the condition "n is a term of the sequence if and only if a(n) is prime" where indices start from 0.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 14, 15, 16, 17, 18, 19, 23, 29, 31, 37, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 59, 60, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 132, 133, 134, 135, 137, 139, 140, 149
Offset: 0

Views

Author

Adnan Baysal, Apr 13 2020

Keywords

Comments

a(n) is the minimal sequence for which the sequence generated by the indices of primes in this sequence is equal to itself, where indices start from 0.
So if f is a function on 0-indexed integer sequences with infinitely many primes where f returns the increasing sequence of indices of primes of the input sequence b(n), then a(n) is the lexicographically minimal fixed point of f.
a(n) has almost the same definition as A079254, except that a(n) starts indices from 0 instead of 1. But the resulting sequences do not seem to have any correlation.

Examples

			a(0) cannot be 0, since then 0 should be prime, which it is not.
a(0) = 1 is valid hence a(1) must be the next prime, which is a(1) = 2.
Then a(2) should be the next prime, hence a(2) = 3.
a(3) should be prime, hence a(3) = 5.
Since 4 is not in the sequence so far, a(4) must be the next nonprime, which means a(4) = 6.
		

Crossrefs

The same definition as A079254 except here the indices start from 0 instead of 1.

Programs

  • Python
    # is_prime(n) is a Python function which returns True if n is prime, and returns False otherwise. In the form stated below runs with SageMath.
    def a_list(length):
        """Returns the list [a(0), ..., a(length-1)]."""
        num = 1
        b = [1]
        for i in range(1, length):
            num += 1
            if i in b:
                while not is_prime(num):
                    num += 1
                b.append(num)
            else:
                while is_prime(num):
                    num += 1
                b.append(num)
        return b
    print(a_list(63))
Showing 1-9 of 9 results.