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.

A354964 a(1) = 1, a(2) = 2, a(3) = 3; for n > 3, a(n) is the smallest new number such that the sum of any four successive terms is prime.

This page as a plain text file.
%I A354964 #30 Aug 24 2022 09:59:09
%S A354964 1,2,3,5,7,4,13,17,9,8,19,11,15,14,21,23,25,10,31,35,27,16,29,37,45,
%T A354964 20,47,39,33,12,43,49,53,6,41,51,59,22,61,55,73,34,65,57,67,38,71,63,
%U A354964 69,24,77,81,75,18,83,87,89,48,93,101,95,28
%N A354964 a(1) = 1, a(2) = 2, a(3) = 3; for n > 3, a(n) is the smallest new number such that the sum of any four successive terms is prime.
%t A354964 s = {1, 2, 3}; Do[a = s[[-1]] + s[[-2]] + s[[-3]]; n = 4; While[MemberQ[s, n] || ! PrimeQ[a + n], n++]; AppendTo[s, n], {120}]; s
%o A354964 (PARI) { s = 0; for (n=1, #a = vector(62), if (n<=3, a[n]=n, for (v=1, oo, if (!bittest(s,v) && isprime(v+a[n-1]+a[n-2]+a[n-3]), a[n]=v; break))); print1 (a[n]", "); s+=2^a[n]) } \\ _Rémy Sigrist_, Jul 03 2022
%Y A354964 Cf. A080164, A336816, A302847.
%Y A354964 See A055265 and A076990 for similar sequences.
%K A354964 nonn
%O A354964 1,2
%A A354964 _Zak Seidov_, Jun 13 2022