login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066937 For n=1,2,3,..., define b(n) as follows: initialize v at v=n; then for k=2,3,4,..., if v>0 and k divides v, replace v with v-k. Set b(n)=v. Then {a(n)} is the subsequence consisting of the nonzero terms of {b(n)}. 1
1, 2, 3, 4, 5, 7, 6, 8, 11, 10, 13, 9, 17, 12, 19, 14, 23, 16, 20, 15, 29, 31, 22, 18, 25, 21, 26, 37, 24, 41, 43, 27, 34, 28, 47, 32, 38, 53, 35, 40, 33, 59, 44, 30, 61, 46, 49, 50, 39, 67, 42, 71, 36, 73, 58, 55, 79, 52, 48, 62, 83, 65, 51, 45, 89, 56, 57, 74, 97, 101, 103 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
A permutation of the positive integers.
LINKS
MATHEMATICA
terms = 71; m0 = 400; dm = 200; Clear[f]; f[m_] := f[m] = (r = Range[m]; Do[r = r /. {n_ /; n > 0 && Mod[n, k] == 0 :> n - k }, {k, 2, Floor[m/2]}]; DeleteCases[r, 0] [[1 ;; terms]]); f[m0]; f[m = m0 + dm]; While[f[m] != f[m - dm], m = m + dm]; f[m] (* Jean-François Alcover, Mar 20 2013 *)
PROG
(PARI) f(n, m)=my(s=Set(divisors(n))); s=setunion(s, Set(m)); s[setsearch(s, m)+1] \\ function for smallest divisor of n that is greater than m
b(n) = if(n==1, 1, local(A=n, B=1, C); until(A<=B, C=A; A=A-f(A, B); B=f(C, B)); A)
my(z=1); forstep(k=1, 299, 1, while(!if(b(z)>0, 1, 0), z++); print1(b(z), ", "); z++; ); \\ Mikhail Kurkov, Mar 11 2022
CROSSREFS
Sequence in context: A343150 A338698 A361946 * A217266 A347539 A209637
KEYWORD
nonn
AUTHOR
John W. Layman, Jan 24 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 05:19 EDT 2024. Contains 371782 sequences. (Running on oeis4.)