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.

A345903 The succession of prime and nonprime terms is kept when you consider the sequence formed by the successive sums a(n) + a(n+1). This is the lexicographically earliest sequence of distinct positive terms with this property.

This page as a plain text file.
%I A345903 #29 Mar 24 2025 06:03:28
%S A345903 2,1,3,4,5,6,8,7,10,11,12,9,13,16,14,18,15,17,20,19,22,23,24,21,25,26,
%T A345903 28,27,29,30,32,31,36,33,35,34,38,37,42,39,41,48,40,44,43,46,45,47,50,
%U A345903 49,51,53,54,52,56,55,57,58,59,68,60,61,66,62,63,65,64,69,67,70
%N A345903 The succession of prime and nonprime terms is kept when you consider the sequence formed by the successive sums a(n) + a(n+1). This is the lexicographically earliest sequence of distinct positive terms with this property.
%H A345903 Dominic McCarty, <a href="/A345903/b345903.txt">Table of n, a(n) for n = 1..10000</a>
%F A345903 a(n) = A345966(n) for n >= 7. - _Pontus von Brömssen_, Jul 03 2021
%e A345903 Here is the succession of primes and nonprimes in the sequence:
%e A345903 2,  1,  3,  4,  5,  6,  8,  7, 10, 11, 12,  9, 13, 16, 14, 18, 15, ...
%e A345903 p   n   p   n   p   n   n   p   n   p   n   n   p   n   n   n   n
%e A345903 The same succession is formed by a(n) + a(n+1):
%e A345903 3,  4,  7,  9, 11, 14, 15, 17, 21, 23, 21, 22, 29, 30, 32, 33, 32, ...
%e A345903 p   n   p   n   p   n   n   p   n   p   n   n   p   n   n   n   n
%t A345903 seq[n_] := Module[{s = {2}, q, k}, Do[q = PrimeQ[s[[-1]]]; k = 1; While[!FreeQ[s, k] || PrimeQ[s[[-1]] + k] != q, k++]; AppendTo[s, k], {n}]; s]; seq[100] (* _Amiram Eldar_, Jul 02 2021 *)
%Y A345903 Cf. A345966.
%K A345903 nonn
%O A345903 1,1
%A A345903 _Eric Angelini_ and _Carole Dubois_, Jul 02 2021