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.

A336761 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - lpf(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + lpf(n), where lpf(n) is the least prime dividing n.

This page as a plain text file.
%I A336761 #16 Jan 09 2021 21:05:16
%S A336761 0,1,3,6,4,9,7,14,12,15,13,2,4,17,19,16,18,35,33,52,50,47,45,22,20,25,
%T A336761 23,26,24,53,51,82,80,77,75,70,68,31,29,32,30,71,69,112,110,107,105,
%U A336761 58,56,49,51,48,46,99,97,92,90,87,85,144,142,81,79,76,74,79,81,148,146,143,141,212,210
%N A336761 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - lpf(n) if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + lpf(n), where lpf(n) is the least prime dividing n.
%C A336761 This sequences uses the same rules as Recamán's sequence A005132 except that, instead of adding or subtracting n each term, the least prime dividing n is used. See A020639.
%C A336761 For the first 100 million terms the smallest value not appearing is 5. As any term for prime n can be the previous term minus n there is no apparent lower bound for the terms as n increases. For example a(16367081) = 601, the previous term being a(16367080) = 16367682. Thus it is possible 5, and eventually all values, are visited, although this is unknown.
%C A336761 In the same range the maximum value is a(98782561) = 602622357, and 7627043 terms repeat a previously visited value, the first time this occurs is a(12) = a(4) = 4. The longest run of consecutive increasing terms is 47, starting at a(96135288) = 26062, while the longest run of consecutive decreasing terms is 238, starting at a(32357989) = 160443385.
%H A336761 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>.
%e A336761 a(2) = 3. As 2 is prime lpf(2) = 2 thus a(2) = a(1) + 2 = 1 + 2 = 3.
%e A336761 a(6) = 7. As lpf(6) = 2 and as 7 has not been previously visited and is nonnegative, a(6) = a(5) - 2 = 9 - 2 = 7.
%Y A336761 Cf. A005132, A020639, A000040, A336760.
%K A336761 nonn
%O A336761 0,3
%A A336761 _Scott R. Shannon_, Aug 03 2020