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.

A169843 EKG sequence started at 6 instead of 2.

This page as a plain text file.
%I A169843 #22 Feb 16 2025 08:33:11
%S A169843 6,2,4,8,10,5,15,3,9,12,14,7,21,18,16,20,22,11,33,24,26,13,39,27,30,
%T A169843 25,35,28,32,34,17,51,36,38,19,57,42,40,44,46,23,69,45,48,50,52,54,56,
%U A169843 49,63,60,55,65,70,58,29,87,66,62,31,93,72,64,68,74,37,111,75,78,76,80,82,41
%N A169843 EKG sequence started at 6 instead of 2.
%C A169843 A generalization of A064413.
%H A169843 Peter Kagey, <a href="/A169843/b169843.txt">Table of n, a(n) for n = 1..10000</a>
%H A169843 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/EKGSequence.html">EKG Sequence</a>
%H A169843 <a href="/index/Ed#EKG">Index entries for sequences related to EKG sequence</a>
%H A169843 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%t A169843 f[s_List] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]]; Nest[f, {6, 2}, 71] (* _Michael De Vlieger_, Jan 21 2016, after _Robert G. Wilson v_ at A064413 *)
%o A169843 (Python)
%o A169843 from math import gcd
%o A169843 def aupton(terms):
%o A169843   alst, aset = [1, 6], {1, 6}
%o A169843   for n in range(2, terms+1):
%o A169843     k = 2
%o A169843     while True:
%o A169843       while k in aset: k += 1
%o A169843       if gcd(alst[-1], k) != 1: alst.append(k); aset.add(k); break
%o A169843       k += 1
%o A169843   return alst[1:]
%o A169843 print(aupton(73)) # _Michael S. Branicky_, Jun 02 2021
%Y A169843 For other initial terms, see A064413, A169837, A169839, A169841, A169845, A169847, A169849, A169851, A169853, A169855.
%K A169843 nonn
%O A169843 1,1
%A A169843 _T. D. Noe_ and _N. J. A. Sloane_, Jun 02 2010