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.

A335923 A variation on Recamán's sequence (A005132): a(0) = 0, a(n) = a(n-1) - n if a(n) is nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + ceiling(n/2).

This page as a plain text file.
%I A335923 #21 Aug 17 2020 23:24:10
%S A335923 0,1,2,4,6,9,3,7,11,16,21,10,16,23,30,15,23,32,14,24,34,13,24,36,12,
%T A335923 25,38,52,66,37,52,68,84,51,17,35,53,72,91,111,71,92,50,72,28,51,5,29,
%U A335923 53,78,103,129,77,104,131,76,20,49,78,19,49,80,18,50,82,115
%N A335923 A variation on Recamán's sequence (A005132): a(0) = 0, a(n) = a(n-1) - n if a(n) is nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + ceiling(n/2).
%C A335923 In this sequence the forward step is reduced from n to ceiling(n/2). As a result, the number of distinct numbers in the sequence as a percentage of the biggest number in the sequence (called "coverage") is increased. For example, for n<=1000000, the number of distinct numbers in this sequence is 694811 and the biggest number is 4350902, giving a coverage of about 15.97% (694811/4350902), higher than that of A005132 (736749/5946126, or about 12.39%).
%C A335923 The smallest missing numbers, h1, from the first m terms of the sequence, given as h1(m), are: 3(6), 5(46), 8(74), 22(646), 33(2551), 114(6009), 166(95445), 331(591310), ... In other words, all integers less than or equal to h1 can be found in the first m+1 terms of the sequence.
%o A335923 (Python)
%o A335923 import math
%o A335923 n_max = 1000000
%o A335923 a_last = 0
%o A335923 list1 = [a_last]
%o A335923 print(0)
%o A335923 for n in range(1, n_max+1):
%o A335923     m = a_last - n
%o A335923     if m >= 0 and m not in list1:
%o A335923         a = m
%o A335923     else:
%o A335923         a = a_last + math.ceil(n/2)
%o A335923     list1.append(a)
%o A335923     print(a)
%o A335923     a_last = a
%Y A335923 Cf. A005132, A335924.
%K A335923 nonn
%O A335923 0,3
%A A335923 _Ya-Ping Lu_, Jun 29 2020