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 11 results. Next

A291544 a(n) = Sum_{k=1..n} A054408(k).

Original entry on oeis.org

2, 3, 7, 13, 23, 31, 43, 59, 73, 97, 127, 149, 167, 193, 227, 263, 283, 311, 349, 389, 421, 463, 509, 557, 601, 653, 709, 769, 823, 881, 947, 997, 1061, 1123, 1193, 1277, 1367, 1439, 1531, 1607, 1693, 1787, 1861, 1949, 2017, 2099, 2179, 2281, 2377, 2477
Offset: 1

Views

Author

Seiichi Manyama, Aug 26 2017

Keywords

Comments

Partial sums of A054408. All terms are prime.

Crossrefs

A254337 Lexicographically earliest sequence of distinct numbers such that no sum of consecutive terms is prime.

Original entry on oeis.org

0, 1, 8, 6, 10, 14, 12, 4, 20, 16, 24, 18, 22, 28, 26, 34, 30, 32, 36, 40, 42, 46, 38, 44, 52, 48, 54, 50, 58, 56, 62, 64, 60, 66, 68, 72, 70, 74, 80, 76, 78, 86, 82, 84, 90, 92, 94, 88, 98, 96, 104, 100, 102, 108, 110, 112, 114, 106, 116, 122, 118, 120, 124, 126, 130, 132, 134, 128, 138, 136, 142, 140, 144, 146, 148, 150, 154, 152, 156, 158
Offset: 0

Views

Author

M. F. Hasler, Jan 28 2015

Keywords

Comments

In other words, no sum a(i)+a(i+1)+a(i+2)+...+a(n) may be prime. In particular, the sequence may not contain any primes.
I conjecture that the sequence contains all even numbers > 2 and no odd number beyond 1. If so, we must simply ensure that the sum a(1)+...+a(n) is not prime, which is always possible for one of the three consecutive even numbers {2n, 2n+2, 2n+4}. As a consequence, it would follow that a(n) ~ 2n.
Is there even a proof that the smallest odd composite number, 9, does not appear?
The variant A254341 has the additional restriction of alternating parity, which avoids excluding the odd numbers.
The least odd composite number a'(n+1) that could occur as the next term after a(n) and such that sum(a(i),i=k...n)+a'(n+1) is composite for all k <= n is (for n = 0, 1, 2,...): 9, 9, 25, 21, 39, 25, 69, 65, 45, 119, 95, 77, 55, 27, 595, 561, 531, 865, 1519, 1479, 1437, 1391, 1353, 1309, 1257, 1209, 1155, 1105, 1047, 2317, 2255, 2191, 3565, 5719, 13067, 12995, 12925, 12851, 12771, 12695, 12617, 12531, 12449, 12365, 12275, ... The growth of this sequence shows how it is increasingly unlikely that an odd number could occur, since the next possible even term is only about 2n.

Examples

			To explain the beginning of the sequence, observe that starting with the smallest possible terms 0, 1 does not appear to lead to a contradiction (and in fact never does), so we start there.
The next composite would be 4 but 1+4=5 is prime, as is 1+6, but 1+8=9 is not, so we take a(2) = 8 to be the next term.
4 is impossible for a(3) since 1+8+4=13 is prime, but neither 1+8+6=15 nor 8+6 is prime, so a(3)=6.
		

Crossrefs

Cf. A025044 (no pairwise sum is prime), A025043 (no pairwise difference is prime).

Programs

  • Mathematica
    f[lst_List] := Block[{k = 1}, While[ PrimeQ@ k || MemberQ[lst, k] || Union@ PrimeQ@ Accumulate@ Reverse@ Join[lst, {k}] != {False}, k++]; Append[lst, k]]; Nest[f, {0}, 70] (* Robert G. Wilson v, Jan 31 2015 *)
  • PARI
    a=[];u=0; for(i=1,99, a=concat(a,0); until( ! isprime(s) || ! a[i]++, while( isprime(a[i]) || bittest(u,a[i]), a[i]++); s=a[k=i]; while( k>1 && ! isprime( s+=a[k--]),)); u+=2^a[i]; print1(a[i]","))

Formula

It appears that a(n) ~ 2n.

A073659 a(1) = 1; for n > 1, a(n) is the smallest even number not already in the sequence such that a(1) + ... + a(n) is a prime.

Original entry on oeis.org

1, 2, 4, 6, 10, 8, 12, 16, 14, 24, 30, 22, 18, 26, 34, 36, 20, 28, 38, 40, 32, 42, 46, 48, 44, 52, 56, 60, 54, 58, 66, 50, 64, 62, 70, 84, 90, 72, 92, 76, 86, 94, 74, 88, 68, 82, 80, 102, 96, 100, 114, 98, 78, 112, 120, 110, 108, 106, 126, 122, 130, 132, 134, 124, 128, 118
Offset: 1

Views

Author

Amarnath Murthy, Aug 10 2002

Keywords

Comments

Essentially the same as A054408. - R. J. Mathar, Dec 15 2008
Conjecture: Every even number appears. - N. J. A. Sloane, May 29 2017

Crossrefs

See A055265 for a version where the sums of two adjacent terms are primes.

Programs

  • Mathematica
    t = {1}; Do[i = 2; While[! PrimeQ[Total[t] + i] || MemberQ[t, i], i += 2]; AppendTo[t, i], {65}]; t (* Jayanta Basu, Jul 04 2013 *)
  • PARI
    v=[1];n=1;while(n<200,if(isprime(n+vecsum(v))&&!vecsearch(vecsort(v),n),v=concat(v,n);n=0);n++);v \\ Derek Orr, Jun 01 2015

Extensions

More terms from Sascha Kurz, Jan 28 2003
Offset corrected by Chai Wah Wu, Aug 27 2017

A180405 Smallest integer not yet present in the sequence such that the sum of the first a(n) terms of the sequence is a prime.

Original entry on oeis.org

2, 1, 4, 6, 3, 7, 8, 10, 11, 15, 12, 18, 14, 16, 22, 24, 19, 31, 28, 20, 23, 37, 36, 30, 26, 34, 29, 35, 42, 38, 40, 32, 39, 45, 52, 44, 54, 46, 56, 60, 43, 51, 50, 64, 84, 48, 49, 53, 68, 58, 62, 78, 70, 66, 57, 59, 82, 92, 90, 88, 63, 77, 72, 94, 67, 79, 76, 102, 71, 81, 96, 100
Offset: 1

Views

Author

Paolo P. Lava, Sep 02 2010

Keywords

Comments

From an idea of Eric Angelini with additional terms from D. S. McNeil.
The partial sums of the sequence are 2, 3, 7, 13, 16, 23, 31, 41, 52, ...
The sequence is self-descriptive and says that the 2nd, 1st, 4th, 6th, 3rd, 7th, etc, term in the partial sums, namely 3, 2, 13, 23, 7, 31 etc, are primes.

Crossrefs

Cf. A054408, A171007 (digits version), A363379 (complement).

Extensions

Examples replaced with a comment by R. J. Mathar, Nov 18 2010

A292388 Lexicographically earliest sequence of distinct positive terms such that, for any n > 0, SumXOR_{k=1..n} a(k) is prime (where SumXOR is the analog of summation under the binary XOR operation).

Original entry on oeis.org

2, 1, 4, 5, 7, 6, 8, 9, 15, 10, 12, 14, 18, 16, 20, 17, 19, 22, 24, 26, 32, 30, 36, 28, 38, 34, 40, 42, 44, 43, 21, 50, 39, 29, 48, 45, 31, 52, 46, 58, 54, 62, 55, 41, 56, 60, 66, 68, 72, 74, 64, 78, 84, 76, 63, 57, 80, 86, 88, 94, 90, 92, 100, 70, 96, 98, 82
Offset: 1

Views

Author

Rémy Sigrist, Sep 15 2017

Keywords

Comments

The partial XOR sums are given by A292389.
This sequence is similar to A054408: here we combine the first terms with the binary XOR operation, there with the classic sum operation.
There are no three consecutive odd terms.
If SumXOR_{k=1..n} a(k) = 2, then a(n+1) is odd.
Is this sequence a permutation of the natural numbers?
The only odd numbers that can appear have the form p XOR 2 for some prime p. Thus 3, 11, 13, 23, 25, 27, 33, 35, 37, 47, ... never appear. - Peter Munn, Jan 19 2023

Examples

			a(1) cannot equal 1 (1 is not prime).
a(1) = 2 is suitable.
a(2) = 1 is suitable.
a(3) cannot equal 1 (already used), 2 (already used) or 3 (2 XOR 1 XOR 3 = 0 is not prime).
a(3) = 4 is suitable.
a(4) cannot equal 1 (already used), 2 (already user), 3 (2 XOR 1 XOR 4 XOR 3 = 4 is not prime) or 4 (already used).
a(4) = 5 is suitable.
		

Crossrefs

Programs

  • PARI
    s=0; x=0; for (n=1, 67, for (v=1, oo, if (!bittest(s,v) && isprime(bitxor(x,v)), s+=2^v; x=bitxor(x,v); print1 (v ", "); break)))

A122866 Consider the array of sequences defined to be "the least previously nonoccurring positive integer such that partial sum + k is prime" beginning with k=0. This sequence is the main diagonal of that array.

Original entry on oeis.org

2, 3, 6, 4, 12, 10, 16, 12, 16, 24, 26, 24, 30, 28, 28, 44, 36, 42, 20, 38, 34, 54, 54, 56, 48, 44, 50, 52, 68, 56, 56, 60, 62, 66, 66, 70, 76, 84, 76, 58, 92, 90, 88, 90, 80, 88, 92, 102, 104, 102, 114, 104, 108, 98, 114, 108, 92, 100, 120, 126, 124, 130, 126, 142, 116, 126
Offset: 0

Views

Author

Keywords

Examples

			The array of sequences begins
k= 0: 2, 1, 4, 6, 10, 8, 12, 16, 14, 24, 30, 22, 18, 26, 34, ...,.
k= 1: 1, 3, 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, ...,.
k= 2: 1, 2, 6, 8, 4, 14, 10, 12, 20, 18, 16, 24, 26, 28, 32, ...,.
k= 3: 2, 6, 8, 4, 14, 10, 12, 20, 18, 16, 24, 26, 28, 32, 34, ...,.
k= 4: 1, 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, 32, ...,.
k= 5: 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, 32, 28, ...,.
		

Crossrefs

Programs

  • Mathematica
    f[s_] := Append[s, k = 1; p = q + Plus @@ s; While[MemberQ[s, k] || !PrimeQ[p + k], k++ ]; k]; T[n_, k_] := Nest[q = k; f, {}, n][[ -1]]; Table[T[n, n - 1], {n, 66}]

Extensions

Offset changed to 0 by Chai Wah Wu, Aug 27 2017

A122867 Consider the array of sequences defined to be "the least previously nonoccurring positive integer such that partial sum + k is prime" beginning with k=0. This sequence is that array read by successive antidiagonals.

Original entry on oeis.org

2, 1, 1, 1, 3, 4, 2, 2, 2, 6, 1, 6, 6, 4, 10, 2, 2, 8, 8, 6, 8, 1, 4, 4, 4, 4, 12, 12, 4, 4, 6, 6, 14, 14, 8, 16, 3, 2, 2, 12, 12, 10, 10, 10, 14, 2, 2, 6, 6, 8, 8, 12, 12, 14, 24, 1, 6, 4, 10, 10, 10, 10, 20, 20, 18, 30, 2, 2, 12, 6, 8, 8, 14, 14, 18, 18, 22, 22, 1, 4, 4, 8, 8, 16, 16, 18, 18, 16
Offset: 1

Views

Author

Keywords

Examples

			The array of sequences begins
k= 0: 2, 1, 4, 6, 10, 8, 12, 16, 14, 24, 30, 22, 18, 26, 34, ...,.
k= 1: 1, 3, 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, ...,.
k= 2: 1, 2, 6, 8, 4, 14, 10, 12, 20, 18, 16, 24, 26, 28, 32, ...,.
k= 3: 2, 6, 8, 4, 14, 10, 12, 20, 18, 16, 24, 26, 28, 32, 34, ...,.
k= 4: 1, 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, 32, ...,.
k= 5: 2, 4, 6, 12, 8, 10, 14, 18, 22, 26, 24, 16, 30, 32, 28, ...,.
		

Crossrefs

Programs

  • Mathematica
    f[s_] := Append[s, k = 1; p = q + Plus @@ s; While[MemberQ[s, k] || !PrimeQ[p + k], k++ ]; k]; T[n_, k_] := Nest[q = k; f, {}, n][[ -1]]; Table[T[k, n - k], {n, 13}, {k, n}] // Flatten

A287662 a(n) is the smallest positive integer not already in sequence such that a(1) + ... + a(n) is a prime power, with a(1) = 1.

Original entry on oeis.org

1, 2, 4, 6, 3, 7, 8, 10, 12, 11, 9, 16, 14, 18, 28, 20, 22, 32, 33, 13, 24, 38, 30, 36, 34, 26, 42, 48, 40, 44, 46, 50, 60, 52, 68, 54, 58, 5, 15, 64, 78, 56, 66, 70, 74, 76, 84, 62, 72, 82, 90, 80, 55, 21, 92, 106, 104, 88, 98, 100, 96, 108, 102, 86, 114, 94, 116, 118, 122, 120, 130, 126, 107, 31, 132, 138
Offset: 1

Views

Author

Ilya Gutkovskiy, May 29 2017

Keywords

Comments

It appears that the sequence contains all even numbers.

Examples

			a(8) = 10 because 1, 2, 3, 4, 6, 7 and 8 have already been used in the sequence, 1 + 2 + 4 + 6 + 3 + 7 + 8 + 5 = 36 is not prime power, 1 + 2 + 4 + 6 + 3 + 7 + 8 + 9 = 40 is not prime power while 1 + 2 + 4 + 6 + 3 + 7 + 8 + 10 = 41 is a prime power.
		

Crossrefs

Programs

  • Mathematica
    t = {1}; Do[i = 1; While[! PrimePowerQ[Total[t] + i] || MemberQ[t, i], i++]; AppendTo[t, i], {75}]; t

A330536 The partial sum a(1)+...+a(n) is prime, and so is the sum of the digits used by those n terms.

Original entry on oeis.org

2, 1, 4, 6, 24, 22, 8, 42, 28, 60, 26, 46, 44, 40, 68, 66, 112, 158, 64, 86, 84, 118, 62, 88, 20, 48, 156, 114, 136, 138, 132, 150, 116, 82, 192, 176, 190, 392, 198, 172, 152, 178, 240, 206, 174, 282, 244, 80, 154, 242, 204, 202, 228, 170, 246, 130, 648, 110, 756, 196, 194, 222, 208, 266, 286, 284, 280, 200
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Dec 17 2019

Keywords

Comments

This is the lexicographically earliest sequence of distinct numbers > 0 with this property.

Examples

			The successive partial sums of terms are prime:
(2), (2 + 1) = 3, (2 + 1 + 4) = 7; (2 + 1 + 4 + 6) = 13; (2 + 1 + 4 + 6 + 24) = 37; etc.
The successive partial sums of their digits are also prime:
(2), (2 + 1) = 3, (2 + 1 + 4) = 7; (2 + 1 + 4 + 6) = 13; (2 + 1 + 4 + 6 + 2 + 4) = 19; etc.
		

Crossrefs

Cf. A054408 (smallest positive integer not already in sequence such that the partial sum a(1)+...+a(n) is prime).

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], PrimeQ[Total@ # + k], PrimeQ@ Total@ Flatten@ IntegerDigits[Append[#, k]]], k++]; k]] &, {}, 68] (* Michael De Vlieger, Dec 17 2019 *)

A366170 Lexicographically earliest sequence of distinct positive integers such that for n>1, Sum_{i=1..n, a(i)<=n} a(a(i)) is prime.

Original entry on oeis.org

1, 2, 4, 8, 6, 12, 5, 7, 10, 18, 13, 11, 14, 16, 17, 24, 20, 22, 21, 15, 19, 26, 3, 23, 9, 30, 28, 32, 31, 29, 40, 42, 34, 36, 37, 44, 35, 27, 41, 50, 46, 39, 33, 56, 47, 52, 68, 49, 43, 54, 53, 51, 60, 58, 57, 45, 66, 55, 61, 74, 64, 63, 84, 72, 67, 78, 65, 59, 70, 90, 73, 80
Offset: 1

Views

Author

Neal Gersh Tolunsky, Oct 02 2023

Keywords

Comments

At a new term k, a(n) = k adds a(k) to the current prime sum if k <= n. If n is a term in the sequence among a(1..n-1), then a(n) = k is added. If neither of these conditions is met, the current prime sum remains the same.
If k is even and a(k) odd, then k cannot appear as a(n) = k at any n >= k (otherwise, the intended prime sum will be even, and thus not prime). This means that some even numbers will miss their chance and never appear. 38 is the smallest missing number.
Can it be proved that every odd number appears?

Examples

			At [1,2], the terms at indices i=1 and i=2, namely 1 and 2, sum to 3, a prime.
At [1,2,4], i=4 is not the index of a term in the sequence yet, so the sum remains the same.
At [1,2,4,8], the sum of the terms at i=1,2,4 is a(1)=1 + a(2)=2 + a(4)=8, which is 11, a prime number.
		

Crossrefs

Showing 1-10 of 11 results. Next