login
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.
0
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, 20, 47, 39, 33, 12, 43, 49, 53, 6, 41, 51, 59, 22, 61, 55, 73, 34, 65, 57, 67, 38, 71, 63, 69, 24, 77, 81, 75, 18, 83, 87, 89, 48, 93, 101, 95, 28
OFFSET
1,2
MATHEMATICA
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
PROG
(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
CROSSREFS
See A055265 and A076990 for similar sequences.
Sequence in context: A191723 A292874 A302847 * A080164 A336816 A182949
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 13 2022
STATUS
approved