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.

A043096 Numbers in which every pair of adjacent digits are distinct.

This page as a plain text file.
%I A043096 #31 Jun 26 2023 12:45:05
%S A043096 0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,
%T A043096 28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,
%U A043096 53,54,56,57,58,59,60,61,62,63,64,65,67,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,101,102,103,104,105,106,107,108,109,120,121,123,124,125,126,127,128,129
%N A043096 Numbers in which every pair of adjacent digits are distinct.
%C A043096 Superset of A010784. - _R. J. Mathar_, Oct 20 2008
%C A043096 Complement of A171901; A196368(a(n)) = 1. - _Reinhard Zumkeller_, Oct 28 2001
%H A043096 Reinhard Zumkeller, <a href="/A043096/b043096.txt">Table of n, a(n) for n = 1..10000</a>
%e A043096 11 is the first number not in the sequence, since it has a pair of identical adjacent digits.
%p A043096 isA034096 := proc(n)
%p A043096     local dgs ;
%p A043096     dgs := convert(n,base,10) ;
%p A043096     for i from 2 to nops(dgs) do
%p A043096         if op(i,dgs) = op(i-1,dgs) then
%p A043096             return false;
%p A043096         end if;
%p A043096     end do:
%p A043096     true ;
%p A043096 end proc:
%p A043096 for n from 0 to 150 do
%p A043096     if isA034096(n) then
%p A043096         printf("%d,",n) ;
%p A043096     end if;
%p A043096 end do: # _R. J. Mathar_, Jun 26 2023
%t A043096 t={}; Do[If[!MemberQ[Differences[IntegerDigits[n]], 0], AppendTo[t,n]], {n,0,69}]; t (* _Jayanta Basu_, May 04 2013 *)
%o A043096 (Haskell)
%o A043096 import Data.List (elemIndices)
%o A043096 a043096 n = a043096_list !! n
%o A043096 a043096_list = elemIndices 1 a196368_list
%o A043096 -- _Reinhard Zumkeller_, Oct 28 2001
%o A043096 (PARI) is(n)=my(v=digits(n));for(i=2,#v,if(v[i]==v[i-1],return(0)));1 \\ _Charles R Greathouse IV_, Sep 17 2012
%o A043096 (Python)
%o A043096 def ok(n): s = str(n); return all(s[i] != s[i+1] for i in range(len(s)-1))
%o A043096 print(list(filter(ok, range(70)))) # _Michael S. Branicky_, Aug 22 2021
%Y A043096 Cf. A010784, A171901, A196368.
%K A043096 nonn,base
%O A043096 1,3
%A A043096 _Clark Kimberling_
%E A043096 Offset corrected by _Reinhard Zumkeller_, Oct 28 2011