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.

User: Yanick Willert

Yanick Willert's wiki page.

Yanick Willert has authored 1 sequences.

A363707 For n >= 2, a(n) = a(n-1) + a(n-2) + A051697(n), a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 3, 7, 13, 25, 43, 75, 125, 207, 343, 561, 915, 1489, 2417, 3919, 6353, 10289, 16659, 26967, 43645, 70631, 114299, 184953, 299275, 484251, 783549, 1267829, 2051407, 3319265, 5370701, 8689997, 14060729, 22750757, 36811517, 59562311, 96373865, 155936213, 252310115
Offset: 0

Author

Yanick Willert, Jun 16 2023

Keywords

Examples

			a(2) = 3 since a(1) + a(0) = 1 and p(2) = 2. Furthermore a(3) = 3 + 1 + p(3) = 7.
		

Crossrefs

Cf. A051697.

Programs

  • Mathematica
    p[n_] := (np = NextPrime[n]; pp = Prime[PrimePi[np] - 1];
       Which[np > 2 n - pp, pp, np < 2 n - pp, np, True, pp]); (* Using the already existing code from A051697 *)
    sequenceLength = 50; (* Specify the desired length of the sequence *)
    sequence = {0,1}; (* Initialize the sequence with the first two terms *)
    For[n = 2, n < sequenceLength, n++,
     nextTerm = sequence[[-2]] + sequence[[-1]] + p[n];
     sequence = Append[sequence, nextTerm]]
    Print[sequence]

Formula

a(0)=0, a(1)=1, a(n) = a(n-1) + a(n-2) + p(n), where p(n) = min{p:p is prime and |p-n| is minimized, and the smaller prime when n is equidistant between primes}.