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.

A080704 a(1)=2; for n>1, if n is in the sequence then a(n) is the smallest even integer > a(n-1), otherwise a(n) = a(n-1) + 3.

This page as a plain text file.
%I A080704 #12 May 14 2022 11:31:36
%S A080704 2,4,7,8,11,14,16,18,21,24,26,29,32,34,37,38,41,42,45,48,50,53,56,58,
%T A080704 61,62,65,68,70,73,76,78,81,82,85,88,90,92,95,98,100,102,105,108,110,
%U A080704 113,116,118,121,122,125,128,130,133,136,138,141,142,145,148
%N A080704 a(1)=2; for n>1, if n is in the sequence then a(n) is the smallest even integer > a(n-1), otherwise a(n) = a(n-1) + 3.
%H A080704 Amiram Eldar, <a href="/A080704/b080704.txt">Table of n, a(n) for n = 1..10000</a>
%H A080704 Amiram Eldar, <a href="/A080704/a080704.jpg">Plot of a(n)/n for n = 10000..100000</a>
%F A080704 It seems that a(n)/n -> 2.4799.... = 62/25 ?
%t A080704 a[1] = 2; a[n_] := a[n] = Module[{s = Array[a, n-1]}, a[n-1] + If[MemberQ[s, n], If[OddQ[a[n-1]], 1, 2], 3]]; Array[a, 100] (* _Amiram Eldar_, May 14 2022 *)
%o A080704 (PARI) for(n=2,400,an[n]=if(setsearch(Set(vector(n-1,i,a(i))),n),if(a(n-1)%2,a(n-1)+1,a(n-1)+2),a(n-1)+3))
%Y A080704 Cf. A080705, A064437, A080717.
%K A080704 nonn,easy
%O A080704 1,1
%A A080704 _Benoit Cloitre_, Mar 01 2003