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

A075594 a(1) = 1, a(2n) = composite, a(2n+1) = prime and sum of two successive terms is alternately prime or composite.

Original entry on oeis.org

1, 4, 2, 9, 3, 8, 7, 6, 19, 10, 5, 12, 13, 16, 11, 18, 17, 14, 31, 22, 23, 20, 29, 24, 41, 26, 37, 30, 47, 32, 43, 28, 53, 36, 59, 38, 61, 40, 71, 42, 73, 34, 83, 44, 67, 46, 79, 48, 97, 52, 89, 50, 103, 54, 101, 56, 109, 58, 107, 60, 127, 64, 113, 66, 137, 62, 139, 72, 131
Offset: 1

Views

Author

Amarnath Murthy, Sep 27 2002

Keywords

Comments

Conjecture: a(n+r)= A075593(n) for n > k for some k and r. What is the value of k and r?
This is not a permutation of the positive integers; odd composites > 9 will not appear in the sequence. - Klaus Brockhaus, Feb 06 2006

Examples

			After terms 1, 4, 2, 9, 3, we seek the next term (n = 6). The requirement is the smallest composite not already seen that summed with a(5) is prime. That number is 8 and becomes a(6). Similarly, for n = 7, we require the smallest prime not already seen that summed with a(6) is composite. As 8 + 5 is not composite, a(7) = 7. - _Bill McEachen_, Feb 13 2023
		

Crossrefs

Programs

  • PARI
    genit(nterms=69)={arr=List();listput(arr,1);listput(arr,4);summ=arr[#arr]+arr[#arr-1];for(ptr=3,+oo,if(#arr>nterms,break);for(i=2,+oo,if(ptr%2!=0&&isprime(i),q=arr[ptr-1]+i;z=Set(arr);if(setsearch(z,i)>0,next);z=Set();if(isprime(summ)&& !isprime(q),listput(arr,i);summ=arr[#arr]+arr[#arr-1];break));if(ptr%2==0&&!isprime(i),q=arr[ptr-1]+i;z=Set(arr);if(setsearch(z,i)>0,next);z=Set();if(!isprime(summ)&& isprime(q),listput(arr,i);summ=arr[#arr]+arr[#arr-1];break))));arr} \\ Bill McEachen, Apr 09 2023

Extensions

Extended by Ray Chandler Feb 16 2005

A075593 a(1) = 1, a(2n) = prime, a(2n+1) = composite and sum of two successive terms is alternately composite or prime.

Original entry on oeis.org

1, 3, 4, 2, 9, 5, 6, 19, 10, 11, 8, 7, 12, 13, 16, 17, 14, 31, 22, 23, 18, 37, 24, 41, 20, 29, 30, 47, 26, 43, 28, 53, 36, 59, 38, 61, 40, 71, 32, 67, 34, 83, 44, 73, 54, 79, 48, 97, 42, 101, 50, 103, 46, 89, 60, 109, 58, 107, 56, 113, 66, 137, 62, 127, 52, 131, 68, 139, 72
Offset: 1

Views

Author

Amarnath Murthy, Sep 27 2002

Keywords

Comments

This is not a permutation of the positive integers; odd composites > 9 will not appear in the sequence. - Klaus Brockhaus, Feb 06 2006

Crossrefs

Extensions

Extended by Ray Chandler Feb 16 2005

A103824 Choose a(n) to be the smallest number not yet used such that: a(1) = 1, a(2n) = prime, a(2n+1) = composite and partial sums are alternately composite or prime.

Original entry on oeis.org

1, 3, 9, 2, 4, 5, 35, 7, 65, 11, 15, 13, 21, 17, 25, 19, 55, 23, 49, 29, 91, 31, 27, 37, 115, 41, 77, 43, 121, 47, 85, 53, 125, 59, 39, 61, 33, 67, 133, 71, 143, 73, 119, 79, 95, 83, 81, 89, 145, 97, 51, 101, 99, 103, 45, 107, 57, 109, 87, 113, 69, 127, 75, 131, 111, 137
Offset: 1

Views

Author

Ray Chandler Feb 16 2005

Keywords

Crossrefs

Extensions

Definition corrected by Zak Seidov, Feb 20 2005

A329423 Each term is visited once according to the rule: go left (resp. right) a(n) places if a(n) is prime (resp. not prime), starting at a(1) = 1. Choose a(n) along this journey as the largest possible prime, or else the smallest possible composite, not occurring earlier and compatible with these rules.

Original entry on oeis.org

1, 4, 6, 8, 9, 3, 12, 14, 5, 21, 25, 7, 20, 10, 51, 16, 26, 22, 11, 15, 34, 2, 28, 17, 63, 42, 48, 33, 36, 32, 13, 18, 23, 60, 19, 24, 52, 91, 45, 29, 69, 55, 27, 39, 66, 58, 116, 78, 85, 37, 30, 105, 94, 90, 35, 75, 81, 77, 112, 43, 31, 41, 65, 106, 38, 50, 72, 44, 141, 47, 133, 180, 100, 150, 49, 121, 168, 128, 110
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 30 2019

Keywords

Comments

More formally: from index i, move to index i - a(i), resp. to i + a(i), if a(i) is prime, resp. not prime.
The sequence is conjectured to be a permutation of the positive integers.
See A330154 for the lexicographic earliest variant, rather than choosing the largest possible prime (and choosing terms following the journey).

Examples

			At index i = 1, a(1) = 1 is the smallest available number and possible since it drives to the right. This implies a move of a(1) = 1 place to the right, i.e., to index i = 2.
Then a(2) cannot be 2 or a larger prime, since this would imply a move too far to the left, so we choose the smallest available composite number, a(2) = 4. This takes us 4 places further to the right, to index 2 + 4 = 6.
Then a(6) can be equal to the prime 3, but not 5 which would drive back to a(1) and create a loop, preventing from visiting all terms. This leads to index 6 - 3 = 3.
Then a(3) cannot be 2 which would lead to already visited a(1), nor a larger prime which would take too far to the left. So a(3) = 6, the smallest available composite number. This leads to index 3 + 6 = 9.
Here a(9) can be a prime, the largest possible choice is a(9) = 5, leading to index 9 - 5 = 4.
Now a(4) cannot be 2 nor 3 nor a larger prime. Therefore a(4) = 8, the smallest available composite number. This leads to index 4 + 8 = 12.
		

Crossrefs

Programs

  • PARI
    upto(N)={ my(U=[1], V=[2], f(k)=(-1)^isprime(k)*k, add(V,t)=if(V[1]+11&&V[2]==V[1]+1,V=V[^1]);V), A=Vec(1,N), done=1, n=1, k,t); while(n<=N||N>=n=valuation(done+1,2), until(!A[n]|| N < n+=f(A[n]), bittest(done,n)&&(n=oo)&&break; done+=1<N&& next; k=n-V[1]; while(U[1] "V[1]" may be incorrect."); A} \\ Use upto(600)[1..90] to get the displayed DATA, for smaller N, terms from a(72) = 180 on may be incorrect. - M. F. Hasler, Dec 05 2019

A103934 Choose a(n) to be the smallest odd number not yet used such that: a(1) = 1, a(2n) = prime, a(2n+1) = composite and partial sums are alternately composite or prime.

Original entry on oeis.org

1, 3, 9, 5, 25, 7, 21, 11, 15, 13, 27, 17, 39, 19, 45, 23, 33, 29, 55, 31, 35, 37, 57, 41, 49, 43, 119, 47, 51, 53, 91, 59, 77, 61, 125, 67, 143, 71, 69, 73, 65, 79, 63, 83, 75, 89, 121, 97, 81, 101, 99, 103, 87, 107, 117, 109, 135, 113, 93, 127, 111, 131, 129, 137, 115, 139
Offset: 1

Views

Author

Ray Chandler Feb 21 2005, based on a suggestion from Zak Seidov

Keywords

Crossrefs

A103935 Choose a(n) to be the smallest odd number not yet used such that: a(1) = 1, a(2n) = composite, a(2n+1) = prime and partial sums are alternately composite or prime.

Original entry on oeis.org

1, 9, 3, 15, 13, 21, 5, 25, 11, 27, 7, 33, 23, 35, 29, 39, 17, 45, 31, 49, 19, 51, 61, 55, 37, 57, 43, 63, 53, 65, 41, 69, 71, 75, 79, 77, 73, 81, 59, 85, 47, 87, 103, 91, 83, 93, 113, 95, 109, 99, 127, 105, 149, 111, 139, 115, 89, 117, 107, 119, 97, 121, 131, 123, 67, 125
Offset: 1

Views

Author

Ray Chandler Feb 21 2005, based on a suggestion from Zak Seidov

Keywords

Crossrefs

Showing 1-6 of 6 results.