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!)
A043940 Numbers k such that 1 and 3 occur juxtaposed in the base-8 representation of k but not of k+1. 2

%I #15 Nov 25 2021 07:32:12

%S 11,25,75,95,139,153,207,217,267,281,331,345,395,409,459,473,523,537,

%T 587,607,651,665,767,779,793,843,857,907,921,971,985,1035,1049,1099,

%U 1119,1163,1177,1231,1241,1291,1305,1355,1369,1419,1433,1483,1497,1547,1561

%N Numbers k such that 1 and 3 occur juxtaposed in the base-8 representation of k but not of k+1.

%H Michael S. Branicky, <a href="/A043940/b043940.txt">Table of n, a(n) for n = 1..10000</a>

%t SequencePosition[Table[If[SequenceCount[IntegerDigits[n,8],{1,3}]>0 || SequenceCount[IntegerDigits[n,8],{3,1}]>0,1,0],{n,1400}],{1,0}][[All,1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Sep 07 2020 *)

%o (Python)

%o def has13or31(n): o = oct(n); return "13" in o or "31" in o

%o def ok(n): return has13or31(n) and not has13or31(n+1)

%o print([k for k in range(1600) if ok(k)]) # _Michael S. Branicky_, Nov 25 2021

%Y Cf. A007094, A043160.

%K nonn,base

%O 1,1

%A _Clark Kimberling_

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 12 07:56 EDT 2024. Contains 371626 sequences. (Running on oeis4.)