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.

A280029 a(1)=3; thereafter, if n odd, a(n) = a(n-1)-st prime, and if n even, a(n) = a(n-1)-st nonprime.

This page as a plain text file.
%I A280029 #31 Aug 13 2025 23:57:51
%S A280029 3,6,13,21,73,98,521,636,4721,5439,53323,59318,737183,801235,12215237,
%T A280029 13068626,238205651,251987681,5381022817,5644769560,138933578143,
%U A280029 144807081479,4053430178401,4203399920996,132332669898119,136669373292795,4793783797371011
%N A280029 a(1)=3; thereafter, if n odd, a(n) = a(n-1)-st prime, and if n even, a(n) = a(n-1)-st nonprime.
%C A280029 This is the sequence S_2 mentioned in A141436. The primes and nonprimes alternate.
%p A280029 # See A280028 for Maple program
%t A280029 nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; a[n_] := a[n] = If[OddQ@ n, Prime@ a[n -1], nonPrime[ a[n -1]]]; a[1] = 3; Array[a, 22] (* _Robert G. Wilson v_, Dec 28 2016 *)
%Y A280029 Cf. A000040, A018252, A141436, A280028, A280030.
%K A280029 nonn
%O A280029 1,1
%A A280029 _N. J. A. Sloane_, Dec 25 2016
%E A280029 a(12)-a(26) from _Hans Havermann_, Dec 25 2016
%E A280029 a(27) from _Chai Wah Wu_, Dec 27 2016