login
a(n) = PS(n)(2n), where PS is described in A057032.
6

%I #17 Apr 24 2024 08:08:20

%S 2,5,9,11,13,19,17,23,31,26,25,40,29,47,58,51,37,69,41,56,71,67,49,82,

%T 70,73,92,95,61,123,65,105,118,94,112,148,77,107,134,116,85,143,89,

%U 122,177,127,97,166,130,133,175,162,109,211,159,188,190,154,121,248,125

%N a(n) = PS(n)(2n), where PS is described in A057032.

%C a(n) = PS(n + c)(2n + c) for any positive integer c. Every positive integer occurs exactly once in either this sequence or in A057032.

%H Alois P. Heinz, <a href="/A069829/b069829.txt">Table of n, a(n) for n = 1..10000</a>

%p A069829 := proc(n) local N, k; N := n;

%p for k from n by -1 to 1 do

%p if irem(N, k) = 0 then

%p if irem(N, k)::odd then

%p N := N - k;

%p else

%p N := N + k;

%p fi;

%p fi;

%p od;

%p N end:

%p seq(A069829(n), n = 1..61); # _Peter Luschny_, Sep 14 2019

%Y Cf. A057032.

%K nonn,look,easy

%O 1,1

%A _David Wasserman_, Apr 22 2002