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.

A234023 Positions n where abs(A234022(n)-A234022(n+1)) > 1.

This page as a plain text file.
%I A234023 #21 May 08 2021 11:24:52
%S A234023 47,51,59,67,75,79,175,179,187,195,203,207,291,299,339,347,419,427,
%T A234023 467,475,531,539,611,619,659,667,739,747,767,771,779,815,831,847,883,
%U A234023 891,899,907,943,959,975,1011,1019,1027,1035,1087,1139,1147,1155,1163,1215
%N A234023 Positions n where abs(A234022(n)-A234022(n+1)) > 1.
%C A234023 These are the indices to A193231 where the count of 1-bits in its terms changes by more than one.
%H A234023 Antti Karttunen, <a href="/A234023/b234023.txt">Table of n, a(n) for n = 1..10000</a>
%H A234023 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, section 1.19, "Invertible transforms on words", pp. 49--55. [This sequence appears on page 50]
%e A234023 47 is in the sequence, as A193231(47) = 59, A193231(48) = 34, and A007088(59)='111011', A007088(34)='100010', thus there are five 1-bits in the former, while there are only two in the latter, and abs(5-2) = 3 > 1.
%o A234023 (Scheme, with _Antti Karttunen_'s IntSeq-library)
%o A234023 (define A234023 (MATCHING-POS 1 1 (lambda (n) (> (abs (- (A234022 n) (A234022 (+ n 1)))) 1))))
%o A234023 (Python)
%o A234023 def a065621(n): return n^(2*(n - (n&-n)))
%o A234023 def a048724(n): return n^(2*n)
%o A234023 def a193231(n):
%o A234023     if n<2: return n
%o A234023     if n%2==0: return a048724(a193231(n//2))
%o A234023     else: return a065621(1 + a193231((n - 1)//2))
%o A234023 def a234022(n): return bin(a193231(n))[2:].count("1")
%o A234023 def ok(n): return abs(a234022(n) - a234022(n + 1))>1
%o A234023 print([n for n in range(1, 1501) if ok(n)]) # _Indranil Ghosh_, Jun 05 2017
%Y A234023 Cf. A234022, A193231.
%K A234023 nonn
%O A234023 1,1
%A A234023 _Antti Karttunen_, Dec 28 2013