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.

A381419 a(1) = 1; for n > 1, a(n) is the smallest unused positive number that is coprime to a(n-1) and has a different binary weight than a(n-1).

This page as a plain text file.
%I A381419 #23 Mar 11 2025 08:23:12
%S A381419 1,3,2,5,4,7,6,11,8,9,13,10,19,12,23,14,15,16,17,21,20,27,22,29,18,25,
%T A381419 24,31,26,33,28,39,32,35,34,37,30,41,36,43,38,45,44,47,40,49,46,55,42,
%U A381419 53,48,59,50,51,52,57,56,61,54,65,58,63,62,67,60,73,64,69,68,71,66,79,70,83
%N A381419 a(1) = 1; for n > 1, a(n) is the smallest unused positive number that is coprime to a(n-1) and has a different binary weight than a(n-1).
%C A381419 A permutation of the natural numbers. - _Ruud H.G. van Tol_, Mar 10 2025
%H A381419 Scott R. Shannon, <a href="/A381419/b381419.txt">Table of n, a(n) for n = 1..10000</a>
%H A381419 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are a permutation of the natural numbers</a>
%e A381419 a(4) = 5 as a(3) = 2 which is coprime to 5 while the binary weight of 5 (101_2) is 2 while the binary weight of 2 (10_2) is 1.
%o A381419 (PARI) lista(n)= my(r=List([1]), p=1, q=p, t); while(p<n, q++; if(#r<=q, listput(~r, #r+1)); if(1==gcd(r[p], t=r[q]) && hammingweight(r[p])!=hammingweight(t), if(q>p+1, forstep(i=q, p+2, -1, r[i]=r[i-1]); r[p+1]=t); q=p++)); Vec(r[1..n]); \\ _Ruud H.G. van Tol_, Mar 10 2025
%Y A381419 Cf. A381821 (fixed points), A381420, A000120, A109451, A093714, A027748.
%K A381419 nonn,base
%O A381419 1,2
%A A381419 _Scott R. Shannon_, Feb 23 2025